pub trait OpenProtoEnum: ProtoEnum {
    type Closed: ClosedProtoEnum;

    // Required method
    fn into_known(self) -> Option<Self::Closed>;

    // Provided methods
    fn name(self) -> Option<&'static str> { ... }
    fn is_known(self) -> bool { ... }
}
Expand description

Trait implemented by enums to help with serialization and deserialization.

Note that this is not a closed enum.

Required Associated Types§

Required Methods§

source

fn into_known(self) -> Option<Self::Closed>

If this is a known variant, returns the corresponding closed enum value.

Provided Methods§

source

fn name(self) -> Option<&'static str>

Get the name of this variant, if it is known.

source

fn is_known(self) -> bool

Whether or not this enum variant is “known” (i.e. there is an associated constant with it).

Object Safety§

This trait is not object safe.

Implementors§