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

A single source file containing protobuf messages and services.

Implementations§

Create a new FileDescriptor referencing the file at index within the given DescriptorPool.

Panics

Panics if index is out-of-bounds.

Gets a reference to the DescriptorPool this file is included in.

Gets the unique name of this file relative to the root of the source tree, e.g. path/to/my_package.proto.

Gets the name of the package specifier for a file, e.g. my.package.

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

Gets the index of this file within the parent DescriptorPool.

Gets the syntax of this protobuf file.

Gets the dependencies of this file.

This corresponds to the FileDescriptorProto::dependency field.

Gets the public dependencies of this file.

This corresponds to the FileDescriptorProto::public_dependency field.

Gets the top-level message types defined within this file.

This does not include nested messages defined within another message.

Gets the top-level enum types defined within this file.

This does not include nested enums defined within another message.

Gets the top-level extension fields defined within this file.

This does not include nested extensions defined within another message.

Gets the services defined within this file.

Gets a reference to the raw FileDescriptorProto wrapped by this FileDescriptor.

Encodes this file descriptor to its byte representation.

The encoded message is equivalent to a FileDescriptorProto, however also includes any extension options that were defined.

Encodes this file descriptor to a newly allocated buffer.

The encoded message is equivalent to a FileDescriptorProto, however also includes any extension options that were defined.

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

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.