pub struct FileDescriptorProto {Show 14 fields
pub name: Option<String>,
pub package: Option<String>,
pub dependency: Vec<String>,
pub public_dependency: Vec<i32>,
pub weak_dependency: Vec<i32>,
pub option_dependency: Vec<String>,
pub message_type: Vec<DescriptorProto>,
pub enum_type: Vec<EnumDescriptorProto>,
pub service: Vec<ServiceDescriptorProto>,
pub extension: Vec<FieldDescriptorProto>,
pub options: MessageField<FileOptions>,
pub source_code_info: MessageField<SourceCodeInfo>,
pub syntax: Option<String>,
pub edition: Option<Edition>,
/* private fields */
}Expand description
Describes a complete .proto file.
Fields§
§name: Option<String>file name, relative to root of source tree
Field 1: name
package: Option<String>e.g. “foo”, “foo.bar”, etc.
Field 2: package
dependency: Vec<String>Names of files imported by this file.
Field 3: dependency
public_dependency: Vec<i32>Indexes of the public imported files in the dependency list above.
Field 10: public_dependency
weak_dependency: Vec<i32>Indexes of the weak imported files in the dependency list. For Google-internal migration only. Do not use.
Field 11: weak_dependency
option_dependency: Vec<String>Names of files imported by this file purely for the purpose of providing option extensions. These are excluded from the dependency list above.
Field 15: option_dependency
message_type: Vec<DescriptorProto>All top-level definitions in this file.
Field 4: message_type
enum_type: Vec<EnumDescriptorProto>Field 5: enum_type
service: Vec<ServiceDescriptorProto>Field 6: service
extension: Vec<FieldDescriptorProto>Field 7: extension
options: MessageField<FileOptions>Field 8: options
source_code_info: MessageField<SourceCodeInfo>This field contains optional information about the original source code. You may safely remove this entire field without harming runtime functionality of the descriptors – the information is needed only by development tools.
Field 9: source_code_info
syntax: Option<String>The syntax of the proto file. The supported values are “proto2”, “proto3”, and “editions”.
If edition is present, this value must be “editions”.
WARNING: This field should only be used by protobuf plugins or special
cases like the proto compiler. Other uses are discouraged and
developers should rely on the protoreflect APIs for their client language.
Field 12: syntax
edition: Option<Edition>The edition of the proto file. WARNING: This field should only be used by protobuf plugins or special cases like the proto compiler. Other uses are discouraged and developers should rely on the protoreflect APIs for their client language.
Field 14: edition
Implementations§
Trait Implementations§
Source§impl Clone for FileDescriptorProto
impl Clone for FileDescriptorProto
Source§fn clone(&self) -> FileDescriptorProto
fn clone(&self) -> FileDescriptorProto
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FileDescriptorProto
impl Debug for FileDescriptorProto
Source§impl Default for FileDescriptorProto
impl Default for FileDescriptorProto
Source§fn default() -> FileDescriptorProto
fn default() -> FileDescriptorProto
Source§impl DefaultInstance for FileDescriptorProto
impl DefaultInstance for FileDescriptorProto
Source§fn default_instance() -> &'static Self
fn default_instance() -> &'static Self
Source§impl ExtensionSet for FileDescriptorProto
impl ExtensionSet for FileDescriptorProto
Source§const PROTO_FQN: &'static str = "google.protobuf.FileDescriptorProto"
const PROTO_FQN: &'static str = "google.protobuf.FileDescriptorProto"
"google.protobuf.FieldOptions". Read moreSource§fn unknown_fields(&self) -> &UnknownFields
fn unknown_fields(&self) -> &UnknownFields
Source§fn unknown_fields_mut(&mut self) -> &mut UnknownFields
fn unknown_fields_mut(&mut self) -> &mut UnknownFields
Source§fn extension<C>(&self, ext: &Extension<C>) -> <C as ExtensionCodec>::Outputwhere
C: ExtensionCodec,
fn extension<C>(&self, ext: &Extension<C>) -> <C as ExtensionCodec>::Outputwhere
C: ExtensionCodec,
Source§fn set_extension<C>(
&mut self,
ext: &Extension<C>,
value: <C as ExtensionCodec>::Value,
)where
C: ExtensionCodec,
fn set_extension<C>(
&mut self,
ext: &Extension<C>,
value: <C as ExtensionCodec>::Value,
)where
C: ExtensionCodec,
Source§fn has_extension<C>(&self, ext: &Extension<C>) -> boolwhere
C: ExtensionCodec,
fn has_extension<C>(&self, ext: &Extension<C>) -> boolwhere
C: ExtensionCodec,
true if any record at the extension’s field number is present. Read moreSource§fn clear_extension<C>(&mut self, ext: &Extension<C>)where
C: ExtensionCodec,
fn clear_extension<C>(&mut self, ext: &Extension<C>)where
C: ExtensionCodec,
Source§fn extension_or_default<C>(
&self,
ext: &Extension<C>,
) -> <C as ExtensionCodec>::Valuewhere
C: ExtensionCodec<Output = Option<<C as ExtensionCodec>::Value>>,
<C as ExtensionCodec>::Value: Default,
fn extension_or_default<C>(
&self,
ext: &Extension<C>,
) -> <C as ExtensionCodec>::Valuewhere
C: ExtensionCodec<Output = Option<<C as ExtensionCodec>::Value>>,
<C as ExtensionCodec>::Value: Default,
[default = ...]
value if absent, or the type’s Default if no proto default was declared. Read moreSource§impl Message for FileDescriptorProto
impl Message for FileDescriptorProto
Source§fn compute_size(&self, __cache: &mut SizeCache) -> u32
fn compute_size(&self, __cache: &mut SizeCache) -> u32
Returns the total encoded size in bytes.
The result is a u32; the protobuf specification requires all
messages to fit within 2 GiB (2,147,483,647 bytes), so a
compliant message will never overflow this type.
Source§fn write_to(&self, __cache: &mut SizeCache, buf: &mut impl BufMut)
fn write_to(&self, __cache: &mut SizeCache, buf: &mut impl BufMut)
cache (populated by a prior
compute_size call on the same cache). Read moreSource§fn merge_field(
&mut self,
tag: Tag,
buf: &mut impl Buf,
depth: u32,
) -> Result<(), DecodeError>
fn merge_field( &mut self, tag: Tag, buf: &mut impl Buf, depth: u32, ) -> Result<(), DecodeError>
buf. Read moreSource§fn encode(&self, buf: &mut impl BufMut)
fn encode(&self, buf: &mut impl BufMut)
Source§fn encode_with_cache(&self, cache: &mut SizeCache, buf: &mut impl BufMut)
fn encode_with_cache(&self, cache: &mut SizeCache, buf: &mut impl BufMut)
SizeCache, for
reuse across many encodes in a hot loop. Clears the cache first.Source§fn encoded_len(&self) -> u32
fn encoded_len(&self) -> u32
Source§fn encode_length_delimited(&self, buf: &mut impl BufMut)
fn encode_length_delimited(&self, buf: &mut impl BufMut)
Source§fn encode_to_bytes(&self) -> Bytes
fn encode_to_bytes(&self) -> Bytes
bytes::Bytes. Read moreSource§fn decode(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
fn decode(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
Source§fn decode_from_slice(data: &[u8]) -> Result<Self, DecodeError>where
Self: Sized,
fn decode_from_slice(data: &[u8]) -> Result<Self, DecodeError>where
Self: Sized,
Source§fn decode_length_delimited(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
fn decode_length_delimited(buf: &mut impl Buf) -> Result<Self, DecodeError>where
Self: Sized,
Source§fn merge_to_limit(
&mut self,
buf: &mut impl Buf,
depth: u32,
limit: usize,
) -> Result<(), DecodeError>
fn merge_to_limit( &mut self, buf: &mut impl Buf, depth: u32, limit: usize, ) -> Result<(), DecodeError>
Source§fn merge_group(
&mut self,
buf: &mut impl Buf,
depth: u32,
field_number: u32,
) -> Result<(), DecodeError>
fn merge_group( &mut self, buf: &mut impl Buf, depth: u32, field_number: u32, ) -> Result<(), DecodeError>
buf, reading fields until an
EndGroup tag with the given field_number is encountered. Read moreSource§fn merge(&mut self, buf: &mut impl Buf, depth: u32) -> Result<(), DecodeError>
fn merge(&mut self, buf: &mut impl Buf, depth: u32) -> Result<(), DecodeError>
Source§fn merge_from_slice(&mut self, data: &[u8]) -> Result<(), DecodeError>
fn merge_from_slice(&mut self, data: &[u8]) -> Result<(), DecodeError>
Source§fn merge_length_delimited(
&mut self,
buf: &mut impl Buf,
depth: u32,
) -> Result<(), DecodeError>
fn merge_length_delimited( &mut self, buf: &mut impl Buf, depth: u32, ) -> Result<(), DecodeError>
Source§impl PartialEq for FileDescriptorProto
impl PartialEq for FileDescriptorProto
Source§fn eq(&self, other: &FileDescriptorProto) -> bool
fn eq(&self, other: &FileDescriptorProto) -> bool
self and other values to be equal, and is used by ==.