pub struct MetadataNode { /* private fields */ }Expand description
Typed doc-comment CST wrapper.
Args: None.
Returns: Stable accessors for doc-comment text and span.
Implementations§
Source§impl MetadataNode
impl MetadataNode
Sourcepub fn cast(syntax: SyntaxNode) -> Option<Self>
pub fn cast(syntax: SyntaxNode) -> Option<Self>
Casts a raw rowan node into a typed doc-comment wrapper.
Args: syntax: Raw rowan syntax node.
Returns: Typed wrapper for structured declaration metadata.
Sourcepub fn range(&self) -> TextRange
pub fn range(&self) -> TextRange
Returns the doc-comment text range.
Args: None.
Returns: Doc-comment range in source text coordinates.
Sourcepub fn text(&self) -> Option<SmolStr>
pub fn text(&self) -> Option<SmolStr>
Returns the comment payload without its marker or field header.
Args: None.
Returns: Trimmed doc-comment payload when present.
Sourcepub fn field(&self) -> Option<(SmolStr, SmolStr)>
pub fn field(&self) -> Option<(SmolStr, SmolStr)>
Returns a structured metadata field when the comment starts with [name].
Sourcepub fn field_range(&self) -> Option<TextRange>
pub fn field_range(&self) -> Option<TextRange>
Returns the source range of a structured metadata field name.
Trait Implementations§
Source§impl Clone for MetadataNode
impl Clone for MetadataNode
Source§fn clone(&self) -> MetadataNode
fn clone(&self) -> MetadataNode
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 MetadataNode
impl !Send for MetadataNode
impl !Sync for MetadataNode
impl !UnwindSafe for MetadataNode
impl Freeze for MetadataNode
impl Unpin for MetadataNode
impl UnsafeUnpin for MetadataNode
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