pub struct SourceFile(/* private fields */);Expand description
The root node of a Compact source file.
Implementations§
Source§impl SourceFile
impl SourceFile
Sourcepub fn pragmas(&self) -> impl Iterator<Item = Pragma>
pub fn pragmas(&self) -> impl Iterator<Item = Pragma>
Iterate over all top-level Pragma declarations.
Sourcepub fn includes(&self) -> impl Iterator<Item = Include>
pub fn includes(&self) -> impl Iterator<Item = Include>
Iterate over all top-level Include declarations.
Sourcepub fn imports(&self) -> impl Iterator<Item = Import>
pub fn imports(&self) -> impl Iterator<Item = Import>
Iterate over all top-level Import declarations.
Sourcepub fn circuit_defs(&self) -> impl Iterator<Item = CircuitDef>
pub fn circuit_defs(&self) -> impl Iterator<Item = CircuitDef>
Iterate over all top-level CircuitDef declarations.
Sourcepub fn struct_defs(&self) -> impl Iterator<Item = StructDef>
pub fn struct_defs(&self) -> impl Iterator<Item = StructDef>
Iterate over all top-level StructDef declarations.
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 if a SyntaxNode with the given kind can be cast to
this AST type.Source§fn cast(node: SyntaxNode) -> Option<Self>
fn cast(node: SyntaxNode) -> Option<Self>
Attempt to cast a
SyntaxNode into this AST type. Read moreSource§fn syntax(&self) -> &SyntaxNode
fn syntax(&self) -> &SyntaxNode
Return a reference to 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 Hash for SourceFile
impl Hash for SourceFile
Source§impl PartialEq for SourceFile
impl PartialEq for SourceFile
Source§fn eq(&self, other: &SourceFile) -> bool
fn eq(&self, other: &SourceFile) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for SourceFile
impl StructuralPartialEq for SourceFile
Auto Trait Implementations§
impl Freeze for SourceFile
impl !RefUnwindSafe for SourceFile
impl !Send for SourceFile
impl !Sync for SourceFile
impl Unpin for SourceFile
impl UnsafeUnpin for SourceFile
impl !UnwindSafe 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