#[non_exhaustive]pub struct DescriptorProto {
pub name: String,
pub field: Vec<FieldDescriptorProto>,
pub extension: Vec<FieldDescriptorProto>,
pub nested_type: Vec<DescriptorProto>,
pub enum_type: Vec<EnumDescriptorProto>,
pub extension_range: Vec<ExtensionRange>,
pub oneof_decl: Vec<OneofDescriptorProto>,
pub options: Option<MessageOptions>,
pub reserved_range: Vec<ReservedRange>,
pub reserved_name: Vec<String>,
/* private fields */
}Expand description
Describes a message type.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: String§field: Vec<FieldDescriptorProto>§extension: Vec<FieldDescriptorProto>§nested_type: Vec<DescriptorProto>§enum_type: Vec<EnumDescriptorProto>§extension_range: Vec<ExtensionRange>§oneof_decl: Vec<OneofDescriptorProto>§options: Option<MessageOptions>§reserved_range: Vec<ReservedRange>§reserved_name: Vec<String>Reserved field names, which may not be used by fields in the same message. A given name may only be reserved once.
Implementations§
Source§impl DescriptorProto
impl DescriptorProto
pub fn new() -> Self
Sourcepub fn set_extension<T, V>(self, v: T) -> Self
pub fn set_extension<T, V>(self, v: T) -> Self
Sourcepub fn set_nested_type<T, V>(self, v: T) -> Self
pub fn set_nested_type<T, V>(self, v: T) -> Self
Sets the value of nested_type.
§Example
ⓘ
let x = DescriptorProto::new()
.set_nested_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_extension_range<T, V>(self, v: T) -> Self
pub fn set_extension_range<T, V>(self, v: T) -> Self
Sets the value of extension_range.
§Example
ⓘ
use google_cloud_wkt::descriptor_proto::ExtensionRange;
let x = DescriptorProto::new()
.set_extension_range([
ExtensionRange::default()/* use setters */,
ExtensionRange::default()/* use (different) setters */,
]);Sourcepub fn set_oneof_decl<T, V>(self, v: T) -> Self
pub fn set_oneof_decl<T, V>(self, v: T) -> Self
Sets the value of oneof_decl.
§Example
ⓘ
use google_cloud_wkt::OneofDescriptorProto;
let x = DescriptorProto::new()
.set_oneof_decl([
OneofDescriptorProto::default()/* use setters */,
OneofDescriptorProto::default()/* use (different) setters */,
]);Sourcepub fn set_options<T>(self, v: T) -> Selfwhere
T: Into<MessageOptions>,
pub fn set_options<T>(self, v: T) -> Selfwhere
T: Into<MessageOptions>,
Sourcepub fn set_or_clear_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<MessageOptions>,
pub fn set_or_clear_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<MessageOptions>,
Sourcepub fn set_reserved_range<T, V>(self, v: T) -> Self
pub fn set_reserved_range<T, V>(self, v: T) -> Self
Sets the value of reserved_range.
§Example
ⓘ
use google_cloud_wkt::descriptor_proto::ReservedRange;
let x = DescriptorProto::new()
.set_reserved_range([
ReservedRange::default()/* use setters */,
ReservedRange::default()/* use (different) setters */,
]);Sourcepub fn set_reserved_name<T, V>(self, v: T) -> Self
pub fn set_reserved_name<T, V>(self, v: T) -> Self
Sets the value of reserved_name.
§Example
ⓘ
let x = DescriptorProto::new().set_reserved_name(["a", "b", "c"]);Trait Implementations§
Source§impl Clone for DescriptorProto
impl Clone for DescriptorProto
Source§fn clone(&self) -> DescriptorProto
fn clone(&self) -> DescriptorProto
Returns a duplicate of the value. Read more
1.0.0 · 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 DescriptorProto
impl Debug for DescriptorProto
Source§impl Default for DescriptorProto
impl Default for DescriptorProto
Source§fn default() -> DescriptorProto
fn default() -> DescriptorProto
Returns the “default value” for a type. Read more
Source§impl Message for DescriptorProto
impl Message for DescriptorProto
Source§impl PartialEq for DescriptorProto
impl PartialEq for DescriptorProto
impl StructuralPartialEq for DescriptorProto
Auto Trait Implementations§
impl Freeze for DescriptorProto
impl RefUnwindSafe for DescriptorProto
impl Send for DescriptorProto
impl Sync for DescriptorProto
impl Unpin for DescriptorProto
impl UnwindSafe for DescriptorProto
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