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: Option<FileOptions>,
pub source_code_info: Option<SourceCodeInfo>,
pub syntax: Option<String>,
pub edition: Option<i32>,
}
Expand description
Describes a complete .proto file.
Fields§
§name: Option<String>
file name, relative to root of source tree
package: Option<String>
e.g. “foo”, “foo.bar”, etc.
dependency: Vec<String>
Names of files imported by this file.
public_dependency: Vec<i32>
Indexes of the public imported files in the dependency list above.
weak_dependency: Vec<i32>
Indexes of the weak imported files in the dependency list. For Google-internal migration only. Do not use.
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.
message_type: Vec<DescriptorProto>
All top-level definitions in this file.
enum_type: Vec<EnumDescriptorProto>
§service: Vec<ServiceDescriptorProto>
§extension: Vec<FieldDescriptorProto>
§options: Option<FileOptions>
§source_code_info: Option<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.
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.
edition: Option<i32>
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.
Implementations§
Source§impl FileDescriptorProto
impl FileDescriptorProto
Sourcepub fn package(&self) -> &str
pub fn package(&self) -> &str
Returns the value of package
, or the default value if package
is unset.
Sourcepub fn syntax(&self) -> &str
pub fn syntax(&self) -> &str
Returns the value of syntax
, or the default value if syntax
is unset.
Sourcepub fn edition(&self) -> Edition
pub fn edition(&self) -> Edition
Returns the enum value of edition
, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_edition(&mut self, value: Edition)
pub fn set_edition(&mut self, value: Edition)
Sets edition
to the provided enum value.
Trait Implementations§
Source§impl Clone for FileDescriptorProto
impl Clone for FileDescriptorProto
Source§fn clone(&self) -> FileDescriptorProto
fn clone(&self) -> FileDescriptorProto
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const 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§impl Message for FileDescriptorProto
impl Message for FileDescriptorProto
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.Source§impl PartialEq for FileDescriptorProto
impl PartialEq for FileDescriptorProto
impl StructuralPartialEq for FileDescriptorProto
Auto Trait Implementations§
impl Freeze for FileDescriptorProto
impl RefUnwindSafe for FileDescriptorProto
impl Send for FileDescriptorProto
impl Sync for FileDescriptorProto
impl Unpin for FileDescriptorProto
impl UnwindSafe for FileDescriptorProto
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request