#[non_exhaustive]pub struct EnumDescriptorProto {
pub name: String,
pub value: Vec<EnumValueDescriptorProto>,
pub options: Option<EnumOptions>,
pub reserved_range: Vec<EnumReservedRange>,
pub reserved_name: Vec<String>,
/* private fields */
}Expand description
Describes an enum 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§value: Vec<EnumValueDescriptorProto>§options: Option<EnumOptions>§reserved_range: Vec<EnumReservedRange>Range of reserved numeric values. Reserved numeric values may not be used by enum values in the same enum declaration. Reserved ranges may not overlap.
reserved_name: Vec<String>Reserved enum value names, which may not be reused. A given name may only be reserved once.
Implementations§
Source§impl EnumDescriptorProto
impl EnumDescriptorProto
pub fn new() -> Self
Sourcepub fn set_options<T>(self, v: T) -> Selfwhere
T: Into<EnumOptions>,
pub fn set_options<T>(self, v: T) -> Selfwhere
T: Into<EnumOptions>,
Sourcepub fn set_or_clear_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<EnumOptions>,
pub fn set_or_clear_options<T>(self, v: Option<T>) -> Selfwhere
T: Into<EnumOptions>,
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::enum_descriptor_proto::EnumReservedRange;
let x = EnumDescriptorProto::new()
.set_reserved_range([
EnumReservedRange::default()/* use setters */,
EnumReservedRange::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 = EnumDescriptorProto::new().set_reserved_name(["a", "b", "c"]);Trait Implementations§
Source§impl Clone for EnumDescriptorProto
impl Clone for EnumDescriptorProto
Source§fn clone(&self) -> EnumDescriptorProto
fn clone(&self) -> EnumDescriptorProto
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 EnumDescriptorProto
impl Debug for EnumDescriptorProto
Source§impl Default for EnumDescriptorProto
impl Default for EnumDescriptorProto
Source§fn default() -> EnumDescriptorProto
fn default() -> EnumDescriptorProto
Returns the “default value” for a type. Read more
Source§impl Message for EnumDescriptorProto
impl Message for EnumDescriptorProto
Source§impl PartialEq for EnumDescriptorProto
impl PartialEq for EnumDescriptorProto
impl StructuralPartialEq for EnumDescriptorProto
Auto Trait Implementations§
impl Freeze for EnumDescriptorProto
impl RefUnwindSafe for EnumDescriptorProto
impl Send for EnumDescriptorProto
impl Sync for EnumDescriptorProto
impl Unpin for EnumDescriptorProto
impl UnwindSafe for EnumDescriptorProto
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