pub struct Block { /* private fields */ }Implementations§
Source§impl Block
impl Block
Sourcepub fn items(&self) -> impl Iterator<Item = SyntaxNode>
pub fn items(&self) -> impl Iterator<Item = SyntaxNode>
Every direct-child node in this block’s body, in source order —
the untyped escape hatch, since a BLOCK’s items span every
declaration/body-line kind this crate defines. Includes a leading
inner DOC_COMMENT, if present — callers that don’t want it in
their item stream (e.g. hir::lower_native::body::lower_block)
filter it out themselves, same as they already skip other
non-statement node kinds.
Sourcepub fn doc(&self) -> Option<DocComment>
pub fn doc(&self) -> Option<DocComment>
The inner //! doc comment, if this block opens with one (B0.6b):
documents the enclosing knot/flow/stitch, not a following
declaration. None for a CHOICE_BODY/ELSE_BRANCH — the parser
never attaches an inner doc there (parser::block::braced_item_list
only checks for one when building a real BLOCK).
Trait Implementations§
Source§impl AstNode for Block
impl AstNode for Block
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 Block
impl StructuralPartialEq for Block
Auto Trait Implementations§
impl !RefUnwindSafe for Block
impl !Send for Block
impl !Sync for Block
impl !UnwindSafe for Block
impl Freeze for Block
impl Unpin for Block
impl UnsafeUnpin for Block
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