Enums allow you to define a type by enumerating its possible variants.
Π¦e can put data directly into each enum variant:
Each variant can have different types and amounts of associated data:
Weβre also able to define methods on enums:
Search
Enums allow you to define a type by enumerating its possible variants.
Π¦e can put data directly into each enum variant:
Each variant can have different types and amounts of associated data:
Weβre also able to define methods on enums: