pub struct UnionVariant {
pub matching_source: Fragment,
pub name: Identifier,
pub ty: Option<Type>,
}Available on crate feature
ast-models only.Expand description
A variant of a UnionDecl, such as some: T or none.
Fields§
§matching_source: FragmentFull matching source of the variant.
name: IdentifierThe name of the variant.
ty: Option<Type>The type of data held by this variant, if any.
Trait Implementations§
Source§impl AstNode for UnionVariant
impl AstNode for UnionVariant
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 UnionVariant
impl Clone for UnionVariant
Source§impl Debug for UnionVariant
impl Debug for UnionVariant
Source§impl PartialEq for UnionVariant
impl PartialEq for UnionVariant
impl StructuralPartialEq for UnionVariant
Auto Trait Implementations§
impl Forget for UnionVariant
impl Freeze for UnionVariant
impl RefUnwindSafe for UnionVariant
impl Send for UnionVariant
impl Sync for UnionVariant
impl Unpin for UnionVariant
impl UnsafeUnpin for UnionVariant
impl UnwindSafe for UnionVariant
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