pub const fn value_ref_internal<ValuedType: Valued>(
    variant: &ValuedType
) -> &'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_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 never panic