Struct protobuf::reflect::FileDescriptor
source · pub struct FileDescriptor { /* private fields */ }
Expand description
Reflection for objects defined in .proto
file (messages, enums, etc).
The object is refcounted: clone is shallow.
The equality performs pointer comparison: two clones of the same FileDescriptor
objects are equal, but two FileDescriptor
objects created from the same FileDescriptorProto
objects are not equal.
Implementations§
source§impl FileDescriptor
impl FileDescriptor
sourcepub fn messages(&self) -> impl Iterator<Item = MessageDescriptor> + '_
pub fn messages(&self) -> impl Iterator<Item = MessageDescriptor> + '_
Top-level messages.
sourcepub fn enums(&self) -> impl Iterator<Item = EnumDescriptor> + '_
pub fn enums(&self) -> impl Iterator<Item = EnumDescriptor> + '_
Get top-level enums.
sourcepub fn services(&self) -> impl Iterator<Item = ServiceDescriptor> + '_
pub fn services(&self) -> impl Iterator<Item = ServiceDescriptor> + '_
Get services defined in .proto
file.
sourcepub fn extensions(&self) -> impl Iterator<Item = FieldDescriptor> + '_
pub fn extensions(&self) -> impl Iterator<Item = FieldDescriptor> + '_
Extension fields.
sourcepub fn message_by_package_relative_name(
&self,
name: &str,
) -> Option<MessageDescriptor>
pub fn message_by_package_relative_name( &self, name: &str, ) -> Option<MessageDescriptor>
Find message by name relative to the package.
Only search in the current file, not in any dependencies.
sourcepub fn enum_by_package_relative_name(
&self,
name: &str,
) -> Option<EnumDescriptor>
pub fn enum_by_package_relative_name( &self, name: &str, ) -> Option<EnumDescriptor>
Find message by name relative to the package.
Only search in the current file, not in any dependencies.
sourcepub fn message_by_full_name(&self, name: &str) -> Option<MessageDescriptor>
pub fn message_by_full_name(&self, name: &str) -> Option<MessageDescriptor>
Find message by fully-qualified name.
Only search in the current file, not in any dependencies.
sourcepub fn enum_by_full_name(&self, name: &str) -> Option<EnumDescriptor>
pub fn enum_by_full_name(&self, name: &str) -> Option<EnumDescriptor>
Find enum by name fully-qualified name.
Only search in the current file, not in any dependencies.
sourcepub fn new_dynamic(
proto: FileDescriptorProto,
dependencies: &[FileDescriptor],
) -> Result<FileDescriptor>
pub fn new_dynamic( proto: FileDescriptorProto, dependencies: &[FileDescriptor], ) -> Result<FileDescriptor>
Dynamic message created from FileDescriptorProto
without generated files.
sourcepub fn new_dynamic_fds(
protos: Vec<FileDescriptorProto>,
dependencies: &[FileDescriptor],
) -> Result<Vec<FileDescriptor>>
pub fn new_dynamic_fds( protos: Vec<FileDescriptorProto>, dependencies: &[FileDescriptor], ) -> Result<Vec<FileDescriptor>>
Create a set of file descriptors from individual file descriptors.
sourcepub fn proto(&self) -> &FileDescriptorProto
pub fn proto(&self) -> &FileDescriptorProto
.proto
data for this file.
sourcepub fn deps(&self) -> &[FileDescriptor]
pub fn deps(&self) -> &[FileDescriptor]
Direct dependencies of this file.
sourcepub fn public_deps(&self) -> impl Iterator<Item = FileDescriptor> + '_
pub fn public_deps(&self) -> impl Iterator<Item = FileDescriptor> + '_
Subset of dependencies which are public
Trait Implementations§
source§impl Clone for FileDescriptor
impl Clone for FileDescriptor
source§fn clone(&self) -> FileDescriptor
fn clone(&self) -> FileDescriptor
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for FileDescriptor
impl Debug for FileDescriptor
source§impl Hash for FileDescriptor
impl Hash for FileDescriptor
source§impl PartialEq for FileDescriptor
impl PartialEq for FileDescriptor
impl Eq for FileDescriptor
impl StructuralPartialEq 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 !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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)