pub struct NamespaceNode { /* private fields */ }Expand description
Typed namespace CST wrapper.
Args: None.
Returns: Stable accessors for namespace name and span.
Implementations§
Source§impl NamespaceNode
impl NamespaceNode
Sourcepub fn cast(syntax: SyntaxNode) -> Option<Self>
pub fn cast(syntax: SyntaxNode) -> Option<Self>
Casts a raw rowan node into a typed namespace wrapper.
Args: syntax: Raw rowan syntax node.
Returns:
Typed namespace wrapper when the kind matches NamespaceBlock.
Sourcepub fn range(&self) -> TextRange
pub fn range(&self) -> TextRange
Returns the namespace text range.
Args: None.
Returns: Namespace range in source text coordinates.
Sourcepub fn name(&self) -> Option<SmolStr>
pub fn name(&self) -> Option<SmolStr>
Returns the namespace name without brackets.
Args: None.
Returns: Namespace name when present.
Sourcepub fn name_range(&self) -> Option<TextRange>
pub fn name_range(&self) -> Option<TextRange>
Returns the namespace name range inside the brackets.
Args: None.
Returns: Namespace name range when present.
Sourcepub fn has_open_brace(&self) -> bool
pub fn has_open_brace(&self) -> bool
Returns whether this namespace starts a braced scope.
Trait Implementations§
Source§impl Clone for NamespaceNode
impl Clone for NamespaceNode
Source§fn clone(&self) -> NamespaceNode
fn clone(&self) -> NamespaceNode
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for NamespaceNode
impl !Send for NamespaceNode
impl !Sync for NamespaceNode
impl !UnwindSafe for NamespaceNode
impl Freeze for NamespaceNode
impl Unpin for NamespaceNode
impl UnsafeUnpin for NamespaceNode
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