// as example a for a gender
enum Gender {
MALE,
FEMININE,
DIVERS,
NONE
}
// impl contains all functions and methods that will be implemented to your enum
impl Gender {...}
/* It is possible to give the options variables as well.
An example:
enum Option<T> {
Some(T),
None
}
*/
enum Color {
WHITE,
BLACK,
}
Color::WHITE;
Color::BLACK;
#[derive(Debug)]
#[allow(dead_code)]
enum ELanguage {
Js,
Rust,
Java,
Cpp,
C
}
#[derive(Debug)]
#[allow(dead_code)]
struct Language {
name: ELanguage
}
fn main() {
let language1 = Language {
name: ELanguage::Rust
};
println!("{:#?}", language1)
}