pub struct EnumVariant<'a> {
pub ident: Cow<'a, str>,
pub value: i64,
pub options: Vec<Option<'a>>,
}Expand description
Enum variant definition inside an enum block.
§Examples
use protobuf_ast_parser::ast::EnumVariant;
let variant = EnumVariant::new("FIRST", 1, vec![]);
assert_eq!(variant.value, 1);Fields§
§ident: Cow<'a, str>§value: i64§options: Vec<Option<'a>>Implementations§
Source§impl EnumVariant<'_>
impl EnumVariant<'_>
Sourcepub fn into_owned(self) -> EnumVariant<'static>
pub fn into_owned(self) -> EnumVariant<'static>
Copy the structure and clone the original values if it’s not owned.
This is always a deep copy of the structure.
Trait Implementations§
Source§impl<'a> Clone for EnumVariant<'a>
impl<'a> Clone for EnumVariant<'a>
Source§fn clone(&self) -> EnumVariant<'a>
fn clone(&self) -> EnumVariant<'a>
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<'a> Debug for EnumVariant<'a>
impl<'a> Debug for EnumVariant<'a>
Source§impl<'a> From<EnumVariant<'a>> for EnumEntry<'a>
impl<'a> From<EnumVariant<'a>> for EnumEntry<'a>
Source§fn from(value: EnumVariant<'a>) -> Self
fn from(value: EnumVariant<'a>) -> Self
Converts to this type from the input type.
Source§impl IntoOwned for EnumVariant<'_>
impl IntoOwned for EnumVariant<'_>
Source§type Owned = EnumVariant<'static>
type Owned = EnumVariant<'static>
The type after obtaining ownership, should be the same as before but with static lifetime.
Source§fn into_owned(self) -> Self::Owned
fn into_owned(self) -> Self::Owned
Copy the structure and clone the original values if it’s not owned. Read more
Source§impl<'a> PartialEq for EnumVariant<'a>
impl<'a> PartialEq for EnumVariant<'a>
impl<'a> StructuralPartialEq for EnumVariant<'a>
Auto Trait Implementations§
impl<'a> Freeze for EnumVariant<'a>
impl<'a> RefUnwindSafe for EnumVariant<'a>
impl<'a> Send for EnumVariant<'a>
impl<'a> Sync for EnumVariant<'a>
impl<'a> Unpin for EnumVariant<'a>
impl<'a> UnwindSafe for EnumVariant<'a>
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