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

A wrapper around a FileDescriptorSet, which provides convenient APIs for the protobuf message definitions.

This type is immutable once constructed, and uses reference counting internally so it is cheap to clone.

Implementations

Create a FileDescriptor from a FileDescriptorSet.

A file descriptor set may be generated by running the protobuf compiler with the --descriptor_set_out flag. If you are using prost-build, then Config::file_descriptor_set_path is a convenient way to generated it as part of your build.

This method may return an error if file_descriptor_set is invalid, for example it contains references to types not in the set. If file_descriptor_set was created by the protobuf compiler, these error cases should never occur since it performs its own validation.

Decodes a FileDescriptorSet from its protobuf byte representation and creates a new FileDescriptor wrapping it.

Gets a reference to the FileDescriptorSet wrapped by this FileDescriptor.

Gets an iterator over the services defined in these protobuf files.

Gets an iterator over all messages defined in these protobuf files.

The iterator includes nested messages defined in another message.

Gets an iterator over all enums defined in these protobuf files.

The iterator includes nested enums defined in another message.

Gets an iterator over all extension fields defined in these protobuf files.

The iterator includes nested extension fields defined in another message.

Gets a MessageDescriptor by its fully qualified name, for example my.package.MessageName.

Gets an EnumDescriptor by its fully qualified name, for example my.package.EnumName.

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

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

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