pub struct Trivia { /* private fields */ }Expand description
A comment or a whitespace trivia in the source code.
Implementations§
Source§impl Trivia
impl Trivia
pub fn new(kind: TriviaPieceKind, range: TextRange, trailing: bool) -> Trivia
Sourcepub fn kind(&self) -> TriviaPieceKind
pub fn kind(&self) -> TriviaPieceKind
Returns the kind of the token
Sourcepub fn trailing(&self) -> bool
pub fn trailing(&self) -> bool
Returns true if this is the trailing trivia of a non-trivia token or false otherwise.
Sourcepub fn text_range(&self) -> TextRange
pub fn text_range(&self) -> TextRange
Returns the text range of this trivia
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Trivia
impl RefUnwindSafe for Trivia
impl Send for Trivia
impl Sync for Trivia
impl Unpin 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