Trait protobuf::ProtobufEnum
source · pub trait ProtobufEnum: Eq + Sized + Copy + 'static {
// Required methods
fn value(&self) -> i32;
fn from_i32(v: i32) -> Option<Self>;
// Provided methods
fn values() -> &'static [Self] { ... }
fn descriptor(&self) -> &'static EnumValueDescriptor { ... }
fn enum_descriptor(&self) -> &'static EnumDescriptor { ... }
fn enum_descriptor_static() -> &'static EnumDescriptor { ... }
}
Expand description
Trait implemented by all protobuf enum types.
Required Methods§
Provided Methods§
sourcefn descriptor(&self) -> &'static EnumValueDescriptor
fn descriptor(&self) -> &'static EnumValueDescriptor
Get enum value descriptor.
sourcefn enum_descriptor(&self) -> &'static EnumDescriptor
fn enum_descriptor(&self) -> &'static EnumDescriptor
Get enum descriptor.
sourcefn enum_descriptor_static() -> &'static EnumDescriptor
fn enum_descriptor_static() -> &'static EnumDescriptor
Get enum descriptor by type.