Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

enum in rust

// 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
    }
*/
 
PREVIOUS NEXT
Tagged: #enum #rust
ADD COMMENT
Topic
Name
7+5 =