pub struct VariantDecl {
pub name: Ident,
pub fields: Vec<TypeExpr>,
pub span: Span,
}Expand description
A single variant within an EnumDecl.
Unit variants have an empty fields vec; tuple-like variants list
their payload types positionally.
Fields§
§name: IdentName of the variant.
fields: Vec<TypeExpr>Payload types for tuple-like variants. Empty for unit variants.
span: SpanSource span of the variant declaration.
Trait Implementations§
Source§impl Clone for VariantDecl
impl Clone for VariantDecl
Source§fn clone(&self) -> VariantDecl
fn clone(&self) -> VariantDecl
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VariantDecl
impl RefUnwindSafe for VariantDecl
impl Send for VariantDecl
impl Sync for VariantDecl
impl Unpin for VariantDecl
impl UnsafeUnpin for VariantDecl
impl UnwindSafe for VariantDecl
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