pub struct FileDescriptor { /* private fields */ }Expand description
Handle to a single proto file inside a DescriptorPool.
Implementations§
Source§impl FileDescriptor
impl FileDescriptor
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
File name as it appears in the descriptor (e.g.
acme/api/v1/user.proto).
Sourcepub fn package(&self) -> &str
pub fn package(&self) -> &str
Proto package declared by the file (acme.api.v1 for the example
above), or the empty string if the file declares none.
Sourcepub fn syntax(&self) -> &str
pub fn syntax(&self) -> &str
Proto syntax (proto2, proto3, or editions).
Defaults to "proto2" when unset, matching the protoc convention.
Sourcepub fn messages(&self) -> impl ExactSizeIterator<Item = MessageDescriptor> + '_
pub fn messages(&self) -> impl ExactSizeIterator<Item = MessageDescriptor> + '_
Top-level messages declared in this file.
Sourcepub fn enums(&self) -> impl ExactSizeIterator<Item = EnumDescriptor> + '_
pub fn enums(&self) -> impl ExactSizeIterator<Item = EnumDescriptor> + '_
Top-level enums declared in this file.
Sourcepub fn parent_pool(&self) -> DescriptorPool
pub fn parent_pool(&self) -> DescriptorPool
Owning DescriptorPool.
Sourcepub fn descriptor_proto(&self) -> &FileDescriptorProto
pub fn descriptor_proto(&self) -> &FileDescriptorProto
Raw FileDescriptorProto for advanced use.
Source§impl FileDescriptor
impl FileDescriptor
Sourcepub fn services(&self) -> impl ExactSizeIterator<Item = ServiceDescriptor> + '_
pub fn services(&self) -> impl ExactSizeIterator<Item = ServiceDescriptor> + '_
Services declared in this file.
Trait Implementations§
Source§impl Clone for FileDescriptor
impl Clone for FileDescriptor
Source§fn clone(&self) -> FileDescriptor
fn clone(&self) -> FileDescriptor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileDescriptor
impl Debug for FileDescriptor
impl Eq for FileDescriptor
Auto Trait Implementations§
impl Freeze for FileDescriptor
impl RefUnwindSafe for FileDescriptor
impl Send for FileDescriptor
impl Sync for FileDescriptor
impl Unpin for FileDescriptor
impl UnsafeUnpin for FileDescriptor
impl UnwindSafe for FileDescriptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more