pub struct ExtensionDescriptor { /* private fields */ }
Expand description

A protobuf extension field definition.

Implementations§

Gets a reference to the DescriptorPool this extension field is defined in.

Gets the FileDescriptor this extension field is defined in.

Gets the parent message type if this extension is defined within another message, or None otherwise.

Note this just corresponds to where the extension is defined in the proto file. See containing_message for the message this field extends.

Gets the short name of the extension field type, e.g. my_extension.

Gets the full name of the extension field, e.g. my.package.ParentMessage.my_extension.

Note this includes the name of the parent message if any, not the message this field extends.

Gets the name of the package this extension field is defined in, e.g. my.package.

If no package name is set, an empty string is returned.

Gets the path where this extension field is defined within the FileDescriptorProto, e.g. [7, 0].

See path for more details on the structure of the path.

Gets a reference to the FileDescriptorProto in which this extension is defined.

Gets a reference to the raw FieldDescriptorProto wrapped by this ExtensionDescriptor.

Decodes the options defined for this ExtensionDescriptor, including any extension options.

Gets the number for this extension field.

Gets the name used for JSON serialization of this extension field, e.g. [my.package.ParentMessage.my_field].

Whether this field is encoded using the proto2 group encoding.

Whether this field is a list type.

Equivalent to checking that the cardinality is Repeated and that is_map returns false.

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.

Whether this field is a list encoded using packed encoding.

The cardinality of this field.

Whether this extension supports distinguishing between an unpopulated field and the default value.

This is equivalent to cardinality() != Cardinality::Repeated

Gets the Kind of this field.

Gets the containing message that this field extends.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.