pub struct EnumVariant {
pub matching_source: Fragment,
pub name: Identifier,
pub discriminant: Option<Expr>,
}Available on crate feature
ast-models only.Expand description
A variant of an EnumDecl, such as Red or Red = 1.
Fields§
§matching_source: FragmentFull matching source of the variant.
name: IdentifierThe name of the variant.
discriminant: Option<Expr>The explicit discriminant value of the variant, if specified.
Trait Implementations§
Source§impl AstNode for EnumVariant
impl AstNode for EnumVariant
Source§fn matching_source(&self) -> &Fragment
fn matching_source(&self) -> &Fragment
Get the Fragment of source code this node was parsed from.
Source§impl Clone for EnumVariant
impl Clone for EnumVariant
Source§impl Debug for EnumVariant
impl Debug for EnumVariant
Source§impl PartialEq for EnumVariant
impl PartialEq for EnumVariant
impl StructuralPartialEq for EnumVariant
Auto Trait Implementations§
impl Forget for EnumVariant
impl Freeze for EnumVariant
impl RefUnwindSafe for EnumVariant
impl Send for EnumVariant
impl Sync for EnumVariant
impl Unpin for EnumVariant
impl UnsafeUnpin for EnumVariant
impl UnwindSafe for EnumVariant
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more