pub const fn value_ref_opt_internal<ValuedType: Valued>(
    variant: &ValuedType
) -> Option<&'static ValuedType::Value>
Expand description

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.

If you need the value as structure but it doesn’t implement clone, use value_opt_internal instead, as it performs a read copy

Note that if implemented correctly (ensured by the declarative macro crate::create_indexed_valued_enum), calling this method will always produce [Option::Some(&Value)]