pub struct Trivia { /* private fields */ }Expand description
A comment retained alongside a lexical atom.
Implementations§
Source§impl Trivia
impl Trivia
Sourcepub fn from_span(kind: TriviaKind, span: Span) -> Self
pub fn from_span(kind: TriviaKind, span: Span) -> Self
Creates trivia from its category and source span.
Sourcepub fn new(kind: TriviaKind, text: impl Into<Arc<str>>, span: Span) -> Self
pub fn new(kind: TriviaKind, text: impl Into<Arc<str>>, span: Span) -> Self
Creates trivia from its category, exact text, and span.
Sourcepub fn kind(&self) -> TriviaKind
pub fn kind(&self) -> TriviaKind
Returns the trivia category.
Trait Implementations§
impl Eq for Trivia
Source§impl FromIterator<Trivia> for TrailingTrivia
impl FromIterator<Trivia> for TrailingTrivia
Source§impl FromIterator<Trivia> for LeadingTrivia
impl FromIterator<Trivia> for LeadingTrivia
Source§impl Lex for Trivia
impl Lex for Trivia
Source§fn to_tokens(&self, output: &mut TokenStream)
fn to_tokens(&self, output: &mut TokenStream)
Appends this value’s token trees to
output.Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Emits this value into a fresh token stream.
Source§impl PrettyTree for Trivia
impl PrettyTree for Trivia
Source§fn pretty_tree(&self) -> PrettyNode
fn pretty_tree(&self) -> PrettyNode
Builds the presentation node for this syntax value.
Source§impl Spanned for Trivia
impl Spanned for Trivia
impl StructuralPartialEq for Trivia
Auto Trait Implementations§
impl Freeze for Trivia
impl RefUnwindSafe for Trivia
impl Send for Trivia
impl Sync for Trivia
impl Unpin for Trivia
impl UnsafeUnpin for Trivia
impl UnwindSafe for Trivia
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