pub struct MessageDescriptor { /* private fields */ }Expand description
A linked message descriptor.
Constructed only by DescriptorPool; not
constructible by downstream crates.
Implementations§
Source§impl MessageDescriptor
impl MessageDescriptor
Sourcepub fn full_name(&self) -> &str
pub fn full_name(&self) -> &str
Fully-qualified proto name without leading dot, e.g.
google.protobuf.Timestamp.
Sourcepub fn options(&self) -> Option<&MessageOptions>
pub fn options(&self) -> Option<&MessageOptions>
The raw MessageOptions for this message, if any were declared.
See FieldDescriptor::options for how to read custom options.
Sourcepub fn fields(&self) -> &[FieldDescriptor]
pub fn fields(&self) -> &[FieldDescriptor]
Fields in source (declaration) order.
Sourcepub fn oneofs(&self) -> &[OneofDescriptor]
pub fn oneofs(&self) -> &[OneofDescriptor]
Oneof declarations, including proto3 synthetic oneofs.
Sourcepub fn extension_ranges(&self) -> &[(u32, u32)]
pub fn extension_ranges(&self) -> &[(u32, u32)]
Extension ranges [start, end).
Sourcepub fn field(&self, number: u32) -> Option<&FieldDescriptor>
pub fn field(&self, number: u32) -> Option<&FieldDescriptor>
Look up a field by its proto field number. O(log n).
Sourcepub fn field_by_name(&self, name: &str) -> Option<&FieldDescriptor>
pub fn field_by_name(&self, name: &str) -> Option<&FieldDescriptor>
Look up a field by its proto field name or JSON name. O(log n).
CEL evaluators and JSON parsers both look fields up by name in a hot loop; this is the supported path. Both the proto field name and the camelCase JSON name resolve.
Sourcepub fn in_extension_range(&self, number: u32) -> bool
pub fn in_extension_range(&self, number: u32) -> bool
Whether number falls within any declared extension range.
Trait Implementations§
Source§impl Clone for MessageDescriptor
impl Clone for MessageDescriptor
Source§fn clone(&self) -> MessageDescriptor
fn clone(&self) -> MessageDescriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more