pub struct ForStmt { /* private fields */ }Implementations§
Source§impl ForStmt
impl ForStmt
Sourcepub fn name_token(&self) -> Option<SyntaxToken>
pub fn name_token(&self) -> Option<SyntaxToken>
The loop-binding identifier (for NAME in …) — the key binding for
the two-binding form (for NAME, val_name in …).
Sourcepub fn val_name_token(&self) -> Option<SyntaxToken>
pub fn val_name_token(&self) -> Option<SyntaxToken>
The second loop-binding identifier (for key, VAL in …), when
present — two-binding map iteration (B2, issue #1461,
docs/stdlib-spec.md §5/§9’s F10 ruling). None for the
single-binding form. Both binding idents are direct FOR_STMT
tokens (the iterable and body are nested nodes, never direct
IDENT children), so the second direct IDENT token is
unambiguously this binding.
Sourcepub fn iterable(&self) -> Option<SyntaxNode>
pub fn iterable(&self) -> Option<SyntaxNode>
The iterable expression — FOR_STMT’s only child node that isn’t
the STMT_BLOCK body.
pub fn body(&self) -> Option<StmtBlock>
Trait Implementations§
Source§impl AstNode for ForStmt
impl AstNode for ForStmt
Source§fn can_cast(kind: SyntaxKind) -> bool
fn can_cast(kind: SyntaxKind) -> bool
Returns
true for a node with a SyntaxKind this type can wrap.Source§fn cast(node: SyntaxNode) -> Option<Self>
fn cast(node: SyntaxNode) -> Option<Self>
Try to cast a generic
SyntaxNode into this typed wrapper.Source§fn syntax(&self) -> &SyntaxNode
fn syntax(&self) -> &SyntaxNode
Access the underlying
SyntaxNode.impl Eq for ForStmt
impl StructuralPartialEq for ForStmt
Auto Trait Implementations§
impl !RefUnwindSafe for ForStmt
impl !Send for ForStmt
impl !Sync for ForStmt
impl !UnwindSafe for ForStmt
impl Freeze for ForStmt
impl Unpin for ForStmt
impl UnsafeUnpin for ForStmt
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