#[non_exhaustive]pub enum TriviaKind {
LineComment,
BlockComment,
CppDirective,
BlankLines(usize),
}Expand description
Source text the lexer consumes but the parser never sees.
Carries exact byte spans so a printer can re-attach comments to nearby AST nodes (which already have positions) and reproduce the original bytes.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
LineComment
-- ... to end of line (newline not included).
BlockComment
{- ... -}, possibly nested; unterminated runs to EOF.
CppDirective
#ifdef/#endif/… preprocessor line at column 1.
BlankLines(usize)
A run of N whitespace-only lines between tokens/comments.
Trait Implementations§
Source§impl Clone for TriviaKind
impl Clone for TriviaKind
Source§fn clone(&self) -> TriviaKind
fn clone(&self) -> TriviaKind
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 moreSource§impl Debug for TriviaKind
impl Debug for TriviaKind
impl Eq for TriviaKind
Source§impl PartialEq for TriviaKind
impl PartialEq for TriviaKind
Source§fn eq(&self, other: &TriviaKind) -> bool
fn eq(&self, other: &TriviaKind) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TriviaKind
Auto Trait Implementations§
impl Freeze for TriviaKind
impl RefUnwindSafe for TriviaKind
impl Send for TriviaKind
impl Sync for TriviaKind
impl Unpin for TriviaKind
impl UnsafeUnpin for TriviaKind
impl UnwindSafe for TriviaKind
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