pub struct LiteralToken {
pub kind: LiteralKind,
pub span: Span,
pub leading_trivia: LeadingTrivia,
pub trailing_trivia: TrailingTrivia,
}Expand description
A literal spelling together with its lexical category and source span.
Struct generated by strutuct! for LiteralToken.
Fields§
§kind: LiteralKindThe literal’s lexical category.
Field LiteralToken::kind generated by strutuct!.
span: SpanField LiteralToken::span generated by strutuct!.
leading_trivia: LeadingTriviaField LiteralToken::leading_trivia generated by strutuct!.
trailing_trivia: TrailingTriviaField LiteralToken::trailing_trivia generated by strutuct!.
Implementations§
Source§impl LiteralToken
impl LiteralToken
Trait Implementations§
Source§impl Clone for LiteralToken
impl Clone for LiteralToken
Source§impl Debug for LiteralToken
impl Debug for LiteralToken
impl Eq for LiteralToken
Source§impl Lex for LiteralToken
impl Lex for LiteralToken
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 Parse for LiteralToken
impl Parse for LiteralToken
Source§fn parse(input: &mut ParseStream) -> Result<Self, TokenParseError>
fn parse(input: &mut ParseStream) -> Result<Self, TokenParseError>
Consumes this value from
input. Read moreSource§impl PartialEq for LiteralToken
impl PartialEq for LiteralToken
Source§impl Spanned for LiteralToken
impl Spanned for LiteralToken
impl StructuralPartialEq for LiteralToken
Source§impl Terminal for LiteralToken
impl Terminal for LiteralToken
Source§fn leading_trivia(&self) -> &LeadingTrivia
fn leading_trivia(&self) -> &LeadingTrivia
Borrows the comments preceding this terminal.
Source§fn leading_trivia_mut(&mut self) -> &mut LeadingTrivia
fn leading_trivia_mut(&mut self) -> &mut LeadingTrivia
Mutably borrows the comments preceding this terminal.
Source§fn trailing_trivia(&self) -> &TrailingTrivia
fn trailing_trivia(&self) -> &TrailingTrivia
Borrows the comments following this terminal.
Source§fn trailing_trivia_mut(&mut self) -> &mut TrailingTrivia
fn trailing_trivia_mut(&mut self) -> &mut TrailingTrivia
Mutably borrows the comments following this terminal.
Source§fn set_leading_trivia(&mut self, trivia: impl IntoIterator<Item = Trivia>)where
Self: Sized,
fn set_leading_trivia(&mut self, trivia: impl IntoIterator<Item = Trivia>)where
Self: Sized,
Replaces the comments preceding this terminal.
Source§fn set_trailing_trivia(&mut self, trivia: impl IntoIterator<Item = Trivia>)where
Self: Sized,
fn set_trailing_trivia(&mut self, trivia: impl IntoIterator<Item = Trivia>)where
Self: Sized,
Replaces the comments and layout characters following this terminal.
Auto Trait Implementations§
impl Freeze for LiteralToken
impl RefUnwindSafe for LiteralToken
impl Send for LiteralToken
impl Sync for LiteralToken
impl Unpin for LiteralToken
impl UnsafeUnpin for LiteralToken
impl UnwindSafe for LiteralToken
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