#[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,
}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
Sourcepub fn set_source_context<T: Into<Option<SourceContext>>>(self, v: T) -> Self
pub fn set_source_context<T: Into<Option<SourceContext>>>(self, v: T) -> Self
Sets the value of source_context.
Sourcepub fn set_syntax<T: Into<Syntax>>(self, v: T) -> Self
pub fn set_syntax<T: Into<Syntax>>(self, v: T) -> Self
Sets the value of syntax.
Sourcepub fn set_edition<T: Into<String>>(self, v: T) -> Self
pub fn set_edition<T: Into<String>>(self, v: T) -> Self
Sets the value of edition.
Sourcepub fn set_enumvalue<T, V>(self, v: T) -> Self
pub fn set_enumvalue<T, V>(self, v: T) -> Self
Sets the value of enumvalue.
Sourcepub fn set_options<T, V>(self, v: T) -> Self
pub fn set_options<T, V>(self, v: T) -> Self
Sets the value of options.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Enum
impl<'de> Deserialize<'de> for Enum
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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