pub enum InterfaceShape {
Interface(InterfaceDef),
ServiceInline(ServiceDef),
}Expand description
One interface shape declared in a file (ridl §14.0): an interface
declaration, or the inline shape of a service (§14.5).
SourceFile::interfaces is not the complete set. A service with an
inline body declares an interface body that is not an InterfaceDef and so
never appears in interfaces(); a pass that walks interfaces() alone
silently skips it. This enum, and SourceFile::shapes that yields it,
are the AST half of the same guarantee ridl_ir::v2::Package::shapes gives
on the IR side — the two halves exist because the blind spot has been found
on both.
Variants§
Interface(InterfaceDef)
A declared interface (ridl §14.0).
ServiceInline(ServiceDef)
The inline shape of a service (ridl §14.5).
Implementations§
Source§impl InterfaceShape
impl InterfaceShape
Sourcepub fn identity(&self) -> Option<String>
pub fn identity(&self) -> Option<String>
The name this shape is known by: an interface declaration’s own
name, or the owning service’s dotted global name — the identity
the IR, the diff paths, and the observer-stub scoping all use. None
when the parser recovered the declaration without a name.
Sourcepub fn identity_range(&self) -> Option<TextRange>
pub fn identity_range(&self) -> Option<TextRange>
The source range of the declared name, for a diagnostic that points at
the shape itself rather than at one of its members. None when the
declaration carries no name node.
Sourcepub fn members(&self) -> AstChildren<InterfaceMember> ⓘ
pub fn members(&self) -> AstChildren<InterfaceMember> ⓘ
The interactions and reserved tombstones of the body, in source
order — InterfaceDef::members or ServiceDef::inline_members.
Sourcepub fn syntax(&self) -> &SyntaxNode
pub fn syntax(&self) -> &SyntaxNode
The underlying declaration node.