pub struct DirectiveNode { /* private fields */ }Expand description
Typed directive CST wrapper.
Args: None.
Returns: Stable accessors for directive name, value and span.
Implementations§
Source§impl DirectiveNode
impl DirectiveNode
Sourcepub fn cast(syntax: SyntaxNode) -> Option<Self>
pub fn cast(syntax: SyntaxNode) -> Option<Self>
Casts a raw rowan node into a typed directive wrapper.
Args: syntax: Raw rowan syntax node.
Returns:
Typed directive wrapper when the kind matches Directive.
Sourcepub fn range(&self) -> TextRange
pub fn range(&self) -> TextRange
Returns the directive text range.
Args: None.
Returns: Directive range in source text coordinates.
Sourcepub fn keyword_range(&self) -> Option<TextRange>
pub fn keyword_range(&self) -> Option<TextRange>
Returns the directive keyword range including the leading !.
Args: None.
Returns:
Range covering a directive keyword such as !shell when present.
Sourcepub fn name(&self) -> Option<SmolStr>
pub fn name(&self) -> Option<SmolStr>
Returns the directive name token text without the leading !.
Args: None.
Returns: Directive name when present.
Trait Implementations§
Source§impl Clone for DirectiveNode
impl Clone for DirectiveNode
Source§fn clone(&self) -> DirectiveNode
fn clone(&self) -> DirectiveNode
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 DirectiveNode
impl !Send for DirectiveNode
impl !Sync for DirectiveNode
impl !UnwindSafe for DirectiveNode
impl Freeze for DirectiveNode
impl Unpin for DirectiveNode
impl UnsafeUnpin for DirectiveNode
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