pub struct WhileStmt { /* private fields */ }Implementations§
Source§impl WhileStmt
impl WhileStmt
pub fn condition(&self) -> Option<Expr>
pub fn body(&self) -> Option<StmtBlock>
Sourcepub fn is_await(&self) -> bool
pub fn is_await(&self) -> bool
Whether this is the persistent-await form while await cond { … }
(docs/flow-suspension-spec.md §3) rather than a plain while loop. The
parser bumps the marker await as a direct IDENT token child (the
while keyword is the only other direct IDENT token; the condition
lives inside an Expr node, never a bare token), so the presence of an
IDENT token spelled await here is the unambiguous marker.
Trait Implementations§
Source§impl AstNode for WhileStmt
impl AstNode for WhileStmt
Source§fn can_cast(kind: SyntaxKind) -> bool
fn can_cast(kind: SyntaxKind) -> bool
Returns
true if a node with the given kind can be cast to Self.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 WhileStmt
impl StructuralPartialEq for WhileStmt
Auto Trait Implementations§
impl !RefUnwindSafe for WhileStmt
impl !Send for WhileStmt
impl !Sync for WhileStmt
impl !UnwindSafe for WhileStmt
impl Freeze for WhileStmt
impl Unpin for WhileStmt
impl UnsafeUnpin for WhileStmt
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