Struct prost_reflect::FieldDescriptor
source · [−]pub struct FieldDescriptor { /* private fields */ }Expand description
A protobuf message definition.
Implementations
sourceimpl FieldDescriptor
impl FieldDescriptor
sourcepub fn parent_pool(&self) -> &DescriptorPool
pub fn parent_pool(&self) -> &DescriptorPool
Gets a reference to the DescriptorPool this field is defined in.
sourcepub fn parent_message(&self) -> &MessageDescriptor
pub fn parent_message(&self) -> &MessageDescriptor
Gets a reference to the MessageDescriptor this field is defined in.
sourcepub fn full_name(&self) -> &str
pub fn full_name(&self) -> &str
Gets the full name of the message field, e.g. my.package.MyMessage.my_field.
sourcepub fn field_descriptor_proto(&self) -> &FieldDescriptorProto
pub fn field_descriptor_proto(&self) -> &FieldDescriptorProto
Gets a reference to the raw FieldDescriptorProto wrapped by this FieldDescriptor.
sourcepub fn json_name(&self) -> &str
pub fn json_name(&self) -> &str
Gets the name used for JSON serialization.
This is usually the camel-cased form of the field name, unless another value is set in the proto file.
sourcepub fn is_list(&self) -> bool
pub fn is_list(&self) -> bool
Whether this field is a list type.
Equivalent to checking that the cardinality is Repeated and that
is_map returns false.
sourcepub fn is_map(&self) -> bool
pub fn is_map(&self) -> bool
Whether this field is a map type.
Equivalent to checking that the cardinality is Repeated and that
the field type is a message where is_map_entry
returns true.
sourcepub fn is_packed(&self) -> bool
pub fn is_packed(&self) -> bool
Whether this field is a list encoded using packed encoding.
sourcepub fn cardinality(&self) -> Cardinality
pub fn cardinality(&self) -> Cardinality
The cardinality of this field.
sourcepub fn supports_presence(&self) -> bool
pub fn supports_presence(&self) -> bool
Whether this field supports distinguishing between an unpopulated field and the default value.
For proto2 messages this returns true for all non-repeated fields.
For proto3 this returns true for message fields, and fields contained
in a oneof.
sourcepub fn containing_oneof(&self) -> Option<OneofDescriptor>
pub fn containing_oneof(&self) -> Option<OneofDescriptor>
Gets a OneofDescriptor representing the oneof containing this field,
or None if this field is not contained in a oneof.
Trait Implementations
sourceimpl Clone for FieldDescriptor
impl Clone for FieldDescriptor
sourcefn clone(&self) -> FieldDescriptor
fn clone(&self) -> FieldDescriptor
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for FieldDescriptor
impl Debug for FieldDescriptor
sourceimpl PartialEq<FieldDescriptor> for FieldDescriptor
impl PartialEq<FieldDescriptor> for FieldDescriptor
sourcefn eq(&self, other: &FieldDescriptor) -> bool
fn eq(&self, other: &FieldDescriptor) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &FieldDescriptor) -> bool
fn ne(&self, other: &FieldDescriptor) -> bool
This method tests for !=.
impl Eq for FieldDescriptor
impl StructuralEq for FieldDescriptor
impl StructuralPartialEq for FieldDescriptor
Auto Trait Implementations
impl RefUnwindSafe for FieldDescriptor
impl Send for FieldDescriptor
impl Sync for FieldDescriptor
impl Unpin for FieldDescriptor
impl UnwindSafe for FieldDescriptor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more