pub struct SourceFile { /* private fields */ }Expand description
A SourceFile node (family.ungram rule SourceFile).
Implementations§
Source§impl SourceFile
impl SourceFile
pub fn package_decl(&self) -> Option<PackageDecl>
pub fn imports(&self) -> AstChildren<Import> ⓘ
pub fn definitions(&self) -> AstChildren<Definition> ⓘ
pub fn interfaces(&self) -> AstChildren<InterfaceDef> ⓘ
pub fn services(&self) -> AstChildren<ServiceDef> ⓘ
pub fn systems(&self) -> AstChildren<SystemDef> ⓘ
pub fn components(&self) -> AstChildren<ComponentDef> ⓘ
pub fn distributions(&self) -> AstChildren<DistributionDef> ⓘ
pub fn deployments(&self) -> AstChildren<DeploymentDef> ⓘ
Source§impl SourceFile
impl SourceFile
Sourcepub fn shapes(&self) -> impl Iterator<Item = InterfaceShape> + '_
pub fn shapes(&self) -> impl Iterator<Item = InterfaceShape> + '_
Every interface shape the file declares — its interface declarations
in source order, then the inline shapes of its service declarations
in source order. See InterfaceShape for why walking
SourceFile::interfaces alone is a defect.
A service that names shapes after : yields nothing: its targets are
declared interfaces and are already in the sequence. The test is the
checker’s own — a service with no : lowers to an inline shape,
whether or not that body turned out to hold any member. The : token
is the form discriminator, so a service the parser recovered with
neither form reads as an inline shape here and in the checker alike.
Trait Implementations§
Source§impl AstNode for SourceFile
impl AstNode for SourceFile
Source§fn cast(syntax: SyntaxNode) -> Option<Self>
fn cast(syntax: SyntaxNode) -> Option<Self>
Wraps
syntax if its kind matches this type; None otherwise.Source§fn syntax(&self) -> &SyntaxNode
fn syntax(&self) -> &SyntaxNode
The underlying untyped node.
Source§impl Clone for SourceFile
impl Clone for SourceFile
Source§impl Debug for SourceFile
impl Debug 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