Skip to main content

HasDocComments

Trait HasDocComments 

Source
pub trait HasDocComments: AstNode {
    // Provided method
    fn doc_comments(&self) -> Vec<SyntaxToken> ⓘ { ... }
}
Expand description

A node that doc comments attach to (typl reference §14). Doc comments are trivia tokens, so they sit before the node rather than inside it.

Provided Methods§

Source

fn doc_comments(&self) -> Vec<SyntaxToken> ⓘ

The DocComment tokens in the trivia run immediately preceding this node, in source order.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§