pub struct EnumDef(/* private fields */);Expand description
export? enum name { variants... } ;?
Implementations§
Source§impl EnumDef
impl EnumDef
Sourcepub fn export_kw(&self) -> Option<SyntaxToken>
pub fn export_kw(&self) -> Option<SyntaxToken>
The export keyword if present.
Sourcepub fn name(&self) -> Option<SyntaxToken>
pub fn name(&self) -> Option<SyntaxToken>
The enum name.
Sourcepub fn variants(&self) -> impl Iterator<Item = EnumVariant>
pub fn variants(&self) -> impl Iterator<Item = EnumVariant>
The enum variants.
Sourcepub fn is_exported(&self) -> bool
pub fn is_exported(&self) -> bool
Whether this enum is exported.
Trait Implementations§
Source§impl AstNode for EnumDef
impl AstNode for EnumDef
Source§fn can_cast(kind: SyntaxKind) -> bool
fn can_cast(kind: SyntaxKind) -> bool
Returns
true if a SyntaxNode with the given kind can be cast to
this AST type.Source§fn cast(node: SyntaxNode) -> Option<Self>
fn cast(node: SyntaxNode) -> Option<Self>
Attempt to cast a
SyntaxNode into this AST type. Read moreSource§fn syntax(&self) -> &SyntaxNode
fn syntax(&self) -> &SyntaxNode
Return a reference to the underlying
SyntaxNode.impl Eq for EnumDef
impl StructuralPartialEq for EnumDef
Auto Trait Implementations§
impl Freeze for EnumDef
impl !RefUnwindSafe for EnumDef
impl !Send for EnumDef
impl !Sync for EnumDef
impl Unpin for EnumDef
impl UnsafeUnpin for EnumDef
impl !UnwindSafe for EnumDef
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