pub struct DocComment { /* private fields */ }Implementations§
Source§impl DocComment
impl DocComment
Sourcepub fn is_inner(&self) -> bool
pub fn is_inner(&self) -> bool
true for the inner (//!) form — a run whose tokens are
DOC_COMMENT_INNER rather than DOC_COMMENT_OUTER. One node shape
covers both variants (syntax_kind.rs’s DOC_COMMENT doc); this is
how callers tell them apart. A well-formed DOC_COMMENT node’s
comment tokens are always uniformly one kind or the other (the
parser’s doc_comment::consume_doc_run never mixes them within a
single run), so checking the first one is sufficient.
Sourcepub fn lines(&self) -> Vec<(String, TextRange)>
pub fn lines(&self) -> Vec<(String, TextRange)>
Every doc-comment line in source order: the token’s text with its
//////! marker stripped and a single leading space (if any)
trimmed, paired with that token’s source range — the same shape the
OLD ink parser’s collect_doc_lines produces, so both frontends
feed the identical format-agnostic hir::doc_block::parse_lines
tag parser.
Trait Implementations§
Source§impl AstNode for DocComment
impl AstNode for DocComment
Source§fn can_cast(kind: SyntaxKind) -> bool
fn can_cast(kind: SyntaxKind) -> bool
true for a node with a SyntaxKind this type can wrap.Source§fn cast(node: SyntaxNode) -> Option<Self>
fn cast(node: SyntaxNode) -> Option<Self>
SyntaxNode into this typed wrapper.Source§fn syntax(&self) -> &SyntaxNode
fn syntax(&self) -> &SyntaxNode
SyntaxNode.Source§impl Clone for DocComment
impl Clone for DocComment
Source§fn clone(&self) -> DocComment
fn clone(&self) -> DocComment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more