Module indexed_valued_enums::valued_enum
source · Expand description
Defines a trait to associate values to an enum
Traits§
- Allows to get a value from an enum’s variant, where this enum implements Indexed, for example, having the following implementation:
Functions§
- Gives the value corresponding for a variant of an enum marked with #[repr(usize)], this is an O(1) operation as it just gets the value as a copy from Valued::VALUES
- Gives the value corresponding for a variant of an enum marked with #[repr(usize)], this is an O(1) operation as it just gets the value as a copy from Valued::VALUES
- Gives the value corresponding for a variant of an enum marked with #[repr(usize)] and implementing the Valued trait, this is an O(1) operation as it just gets a reference to the value as a copy.
- Gives the value corresponding for a variant of an enum marked with #[repr(usize)] and implementing the Valued trait, this is an O(1) operation as it just gets a reference to the value as a copy.