#[non_exhaustive]pub struct Enum {
pub name: String,
pub enumvalue: Vec<EnumValue>,
pub options: Vec<Option>,
pub source_context: Option<SourceContext>,
pub syntax: Syntax,
pub edition: String,
/* private fields */
}Expand description
Enum type definition.
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: StringEnum type name.
enumvalue: Vec<EnumValue>Enum value definitions.
options: Vec<Option>Protocol buffer options.
source_context: Option<SourceContext>The source context.
syntax: SyntaxThe source syntax.
edition: StringThe source edition string, only valid when syntax is SYNTAX_EDITIONS.
Implementations§
Source§impl Enum
impl Enum
pub fn new() -> Self
Sourcepub fn set_enumvalue<T, V>(self, v: T) -> Self
pub fn set_enumvalue<T, V>(self, v: T) -> Self
Sourcepub fn set_options<T, V>(self, v: T) -> Self
pub fn set_options<T, V>(self, v: T) -> Self
Sourcepub fn set_source_context<T>(self, v: T) -> Selfwhere
T: Into<SourceContext>,
pub fn set_source_context<T>(self, v: T) -> Selfwhere
T: Into<SourceContext>,
Sets the value of source_context.
§Example
ⓘ
use google_cloud_wkt::SourceContext;
let x = Enum::new().set_source_context(SourceContext::default()/* use setters */);Sourcepub fn set_or_clear_source_context<T>(self, v: Option<T>) -> Selfwhere
T: Into<SourceContext>,
pub fn set_or_clear_source_context<T>(self, v: Option<T>) -> Selfwhere
T: Into<SourceContext>,
Sets or clears the value of source_context.
§Example
ⓘ
use google_cloud_wkt::SourceContext;
let x = Enum::new().set_or_clear_source_context(Some(SourceContext::default()/* use setters */));
let x = Enum::new().set_or_clear_source_context(None::<SourceContext>);Sourcepub fn set_syntax<T: Into<Syntax>>(self, v: T) -> Self
pub fn set_syntax<T: Into<Syntax>>(self, v: T) -> Self
Trait Implementations§
impl StructuralPartialEq for Enum
Auto Trait Implementations§
impl Freeze for Enum
impl RefUnwindSafe for Enum
impl Send for Enum
impl Sync for Enum
impl Unpin for Enum
impl UnwindSafe for Enum
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