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

A protobuf message definition.

Implementations

Gets a reference to the FileDescriptor this field is defined in.

Gets a reference to the MessageDescriptor this field is defined in.

Gets the short name of the message type, e.g. my_field.

Gets the full name of the message field, e.g. my.package.MyMessage.my_field.

Gets the unique number for this message field.

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.

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 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.

Gets the Kind of this field.

Gets a OneofDescriptor representing the oneof containing this field, or None if this field is not contained in a oneof.

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 ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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.