pub struct Struct(/* private fields */);Expand description
A named or anonymous struct: Name( field: v, .. ) or ( field: v, .. ).
Implementations§
Source§impl Struct
impl Struct
Sourcepub fn cast(node: SyntaxNode) -> Option<Self>
pub fn cast(node: SyntaxNode) -> Option<Self>
Wrap a SyntaxKind::Struct node, or None for any other kind.
Sourcepub fn syntax(&self) -> &SyntaxNode
pub fn syntax(&self) -> &SyntaxNode
The underlying SyntaxNode.
Sourcepub fn name(&self) -> Option<SyntaxToken>
pub fn name(&self) -> Option<SyntaxToken>
The struct’s name token (Ident) for a named struct, or None for an
anonymous ( field: v, .. ) struct.
Sourcepub fn fields(&self) -> impl Iterator<Item = StructField> + '_
pub fn fields(&self) -> impl Iterator<Item = StructField> + '_
The field: value entries, in source order.
Trait Implementations§
impl Eq for Struct
impl StructuralPartialEq for Struct
Auto Trait Implementations§
impl !RefUnwindSafe for Struct
impl !Send for Struct
impl !Sync for Struct
impl !UnwindSafe for Struct
impl Freeze for Struct
impl Unpin for Struct
impl UnsafeUnpin for Struct
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