#[non_exhaustive]pub struct FileDescriptorProto {Show 13 fields
pub name: String,
pub package: String,
pub dependency: Vec<String>,
pub public_dependency: Vec<i32>,
pub weak_dependency: Vec<i32>,
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: String,
pub edition: Edition,
/* private fields */
}Expand description
Describes a complete .proto file.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: String§package: String§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.
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: StringThe syntax of the proto file. The supported values are “proto2”, “proto3”, and “editions”.
If edition is present, this value must be “editions”.
edition: EditionThe edition of the proto file.
Implementations§
Source§impl FileDescriptorProto
impl FileDescriptorProto
pub fn new() -> Self
Sourcepub fn set_package<T: Into<String>>(self, v: T) -> Self
pub fn set_package<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_dependency<T, V>(self, v: T) -> Self
pub fn set_dependency<T, V>(self, v: T) -> Self
Sets the value of dependency.
§Example
let x = FileDescriptorProto::new().set_dependency(["a", "b", "c"]);Sourcepub fn set_public_dependency<T, V>(self, v: T) -> Self
pub fn set_public_dependency<T, V>(self, v: T) -> Self
Sets the value of public_dependency.
§Example
let x = FileDescriptorProto::new().set_public_dependency([1, 2, 3]);Sourcepub fn set_weak_dependency<T, V>(self, v: T) -> Self
pub fn set_weak_dependency<T, V>(self, v: T) -> Self
Sets the value of weak_dependency.
§Example
let x = FileDescriptorProto::new().set_weak_dependency([1, 2, 3]);Sourcepub fn set_message_type<T, V>(self, v: T) -> Self
pub fn set_message_type<T, V>(self, v: T) -> Self
Sets the value of message_type.
§Example
use google_cloud_wkt::DescriptorProto;
let x = FileDescriptorProto::new()
.set_message_type([
DescriptorProto::default()/* use setters */,
DescriptorProto::default()/* use (different) setters */,
]);Sourcepub fn set_enum_type<T, V>(self, v: T) -> Self
pub fn set_enum_type<T, V>(self, v: T) -> Self
Sourcepub fn set_service<T, V>(self, v: T) -> Self
pub fn set_service<T, V>(self, v: T) -> Self
Sourcepub fn set_extension<T, V>(self, v: T) -> Self
pub fn set_extension<T, V>(self, v: T) -> Self
Sourcepub fn set_options<T>(self, v: T) -> Selfwhere
T: Into<FileOptions>,
pub fn set_options<T>(self, v: T) -> Selfwhere
T: Into<FileOptions>,
Sourcepub fn set_or_clear_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<FileOptions>,
pub fn set_or_clear_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<FileOptions>,
Sourcepub fn set_source_code_info<T>(self, v: T) -> Selfwhere
T: Into<SourceCodeInfo>,
pub fn set_source_code_info<T>(self, v: T) -> Selfwhere
T: Into<SourceCodeInfo>,
Sets the value of source_code_info.
§Example
use google_cloud_wkt::SourceCodeInfo;
let x = FileDescriptorProto::new().set_source_code_info(SourceCodeInfo::default()/* use setters */);Sourcepub fn set_or_clear_source_code_info<T>(self, v: Option<T>) -> Selfwhere
T: Into<SourceCodeInfo>,
pub fn set_or_clear_source_code_info<T>(self, v: Option<T>) -> Selfwhere
T: Into<SourceCodeInfo>,
Sets or clears the value of source_code_info.
§Example
use google_cloud_wkt::SourceCodeInfo;
let x = FileDescriptorProto::new().set_or_clear_source_code_info(Some(SourceCodeInfo::default()/* use setters */));
let x = FileDescriptorProto::new().set_or_clear_source_code_info(None::<SourceCodeInfo>);Sourcepub fn set_syntax<T: Into<String>>(self, v: T) -> Self
pub fn set_syntax<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_edition<T: Into<Edition>>(self, v: T) -> Self
pub fn set_edition<T: Into<Edition>>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for FileDescriptorProto
impl Clone for FileDescriptorProto
Source§fn clone(&self) -> FileDescriptorProto
fn clone(&self) -> FileDescriptorProto
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more