Struct protobuf::reflect::EnumDescriptor
source · pub struct EnumDescriptor { /* private fields */ }
Expand description
Dynamic representation of enum type.
Can be used in reflective operations.
Implementations§
source§impl EnumDescriptor
impl EnumDescriptor
sourcepub fn for_type<E: ProtobufEnum>() -> &'static EnumDescriptor
pub fn for_type<E: ProtobufEnum>() -> &'static EnumDescriptor
EnumDescriptor
for enum type
sourcepub fn new(
rust_name: &'static str,
file: &'static FileDescriptorProto
) -> EnumDescriptor
👎Deprecated since 2.12: Please regenerate .rs files from .proto files to use newer APIs
pub fn new( rust_name: &'static str, file: &'static FileDescriptorProto ) -> EnumDescriptor
Create new enum descriptor.
This function is called by generated code, and should not be called manually.
sourcepub fn new_pb_name<E>(
name_in_file: &'static str,
file: &'static FileDescriptorProto
) -> EnumDescriptorwhere
E: ProtobufEnum,
pub fn new_pb_name<E>( name_in_file: &'static str, file: &'static FileDescriptorProto ) -> EnumDescriptorwhere E: ProtobufEnum,
Create new enum descriptor.
This function is called by generated code, and should not be called manually.
sourcepub fn value_by_name<'a>(&'a self, name: &str) -> &'a EnumValueDescriptor
pub fn value_by_name<'a>(&'a self, name: &str) -> &'a EnumValueDescriptor
Find enum value by name
sourcepub fn value_by_number<'a>(&'a self, number: i32) -> &'a EnumValueDescriptor
pub fn value_by_number<'a>(&'a self, number: i32) -> &'a EnumValueDescriptor
Find enum value by number
Auto Trait Implementations§
impl RefUnwindSafe for EnumDescriptor
impl Send for EnumDescriptor
impl Sync for EnumDescriptor
impl Unpin for EnumDescriptor
impl UnwindSafe for EnumDescriptor
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more