Struct protobuf::reflect::FieldDescriptor[][src]

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

Field descriptor.

Can be used for runtime reflection.

Implementations

Get .proto description of field

Field name as specified in .proto file

Oneof descriptor containing this field.

JSON field name.

Can be different from .proto field name.

See JSON mapping for details.

If this field is optional or required.

If this field repeated or map?

Is this field repeated, but not map field?

If this field a map field?

Check if field is set in given message.

For repeated field or map field return true if collection is not empty.

Panics

If this field belongs to a different message type.

Get message field or default instance if field is unset.

Panics

If this field belongs to a different message type or field type is not message.

Get a mutable reference to a message field. Initialize field with default message if unset.

Panics

If this field belongs to a different message type or field type is not singular message.

Default value.

Panics

If field is not singular.

Get singular field value.

Return field default value if field is unset.

Panics

If this field belongs to a different message type or fields is not singular.

Runtime representation of singular field.

Panics

If this field belongs to a different message type or field is not singular.

Set singular field.

Panics

If this field belongs to a different message type or field is not singular or value is of different type.

Dynamic representation of field type.

Get field of any type.

Panics

If this field belongs to a different message type.

Get singular field value.

Return None if field is unset.

Panics

If this field belongs to a different message type or fields is not singular.

Get repeated field.

Panics

If this field belongs to a different message type or field is not repeated.

Get a mutable reference to repeated field.

Panics

If this field belongs to a different message type or field is not repeated.

Get map field.

Panics

If this field belongs to a different message type or field is not map.

Get a mutable reference to map field.

Panics

If this field belongs to a different message type or field is not map.

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

Converts the given value to a String. 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.