pub struct SourceFile { /* private fields */ }Implementations§
Source§impl SourceFile
impl SourceFile
Sourcepub fn flows(&self) -> impl Iterator<Item = FlowDecl>
pub fn flows(&self) -> impl Iterator<Item = FlowDecl>
Every top-level flow/fn declaration in the file (charter §4:
“no one-flow-per-file constraint — files hold many declarations”).
Sourcepub fn syntax_children(&self) -> impl Iterator<Item = SyntaxNode>
pub fn syntax_children(&self) -> impl Iterator<Item = SyntaxNode>
Every direct child node, typed as its own SyntaxKind where a
wrapper exists — the generic escape hatch for callers that want to
walk the whole item list without matching on every variant twice.
Sourcepub fn doc(&self) -> Option<DocComment>
pub fn doc(&self) -> Option<DocComment>
The file-level inner //! doc comment, if the file opens with one
(B0.6b: “documents the enclosing … file”). CST-only for now — no
native HIR type represents whole-file identity yet (lower_native’s
module doc, judgment call #7), so nothing consumes this today; kept
for the LSP/fmt/source-map consumers the ruling names.
Trait Implementations§
Source§impl AstNode for SourceFile
impl AstNode for SourceFile
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.Source§impl Clone for SourceFile
impl Clone for SourceFile
Source§fn clone(&self) -> SourceFile
fn clone(&self) -> SourceFile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SourceFile
impl Debug for SourceFile
Source§impl Display for SourceFile
impl Display for SourceFile
impl Eq for SourceFile
Source§impl Hash for SourceFile
impl Hash for SourceFile
Source§impl PartialEq for SourceFile
impl PartialEq for SourceFile
impl StructuralPartialEq for SourceFile
Auto Trait Implementations§
impl !RefUnwindSafe for SourceFile
impl !Send for SourceFile
impl !Sync for SourceFile
impl !UnwindSafe for SourceFile
impl Freeze for SourceFile
impl Unpin for SourceFile
impl UnsafeUnpin for SourceFile
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