[][src]Trait protobuf::ProtobufEnum

pub trait ProtobufEnum: Eq + Sized + Copy + 'static {
    fn value(&self) -> i32;
fn from_i32(v: i32) -> Option<Self>; fn values() -> &'static [Self] { ... }
fn descriptor(&self) -> &'static EnumValueDescriptor { ... }
fn enum_descriptor(&self) -> &'static EnumDescriptor { ... }
fn enum_descriptor_static() -> &'static EnumDescriptor { ... } }

Trait implemented by all protobuf enum types.

Required methods

fn value(&self) -> i32

Get enum i32 value.

fn from_i32(v: i32) -> Option<Self>

Try to create an enum from i32 value. Return None if value is unknown.

Loading content...

Provided methods

fn values() -> &'static [Self]

Get all enum values for enum type.

fn descriptor(&self) -> &'static EnumValueDescriptor

Get enum value descriptor.

fn enum_descriptor(&self) -> &'static EnumDescriptor

Get enum descriptor.

fn enum_descriptor_static() -> &'static EnumDescriptor

Get enum descriptor by type.

Loading content...

Implementors

impl ProtobufEnum for FieldDescriptorProto_Label[src]

impl ProtobufEnum for FieldDescriptorProto_Type[src]

impl ProtobufEnum for FieldOptions_CType[src]

impl ProtobufEnum for FieldOptions_JSType[src]

impl ProtobufEnum for FileOptions_OptimizeMode[src]

impl ProtobufEnum for Field_Cardinality[src]

impl ProtobufEnum for Field_Kind[src]

impl ProtobufEnum for NullValue[src]

impl ProtobufEnum for Syntax[src]

Loading content...