pub struct IdentToken { /* private fields */ }Expand description
An identifier spelling and its source span.
Implementations§
Source§impl IdentToken
impl IdentToken
Sourcepub fn from_span(span: Span) -> Self
pub fn from_span(span: Span) -> Self
Creates an identifier from its source span.
§Panics
Panics when the span cannot resolve its source text.
Sourcepub fn source_qualifier(&self) -> Option<&Span>
pub fn source_qualifier(&self) -> Option<&Span>
Returns the Source$ prefix, including its $, when present.
Sourcepub fn index_qualifier(&self) -> Option<&Span>
pub fn index_qualifier(&self) -> Option<&Span>
Returns the $0 suffix, including its $, when present.
Trait Implementations§
Source§impl Clone for IdentToken
impl Clone for IdentToken
Source§impl Debug for IdentToken
impl Debug for IdentToken
impl Eq for IdentToken
Source§impl Lex for IdentToken
impl Lex for IdentToken
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 IdentToken
impl Parse for IdentToken
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 IdentToken
impl PartialEq for IdentToken
Source§impl Spanned for IdentToken
impl Spanned for IdentToken
impl StructuralPartialEq for IdentToken
Source§impl Terminal for IdentToken
impl Terminal for IdentToken
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 IdentToken
impl RefUnwindSafe for IdentToken
impl Send for IdentToken
impl Sync for IdentToken
impl Unpin for IdentToken
impl UnsafeUnpin for IdentToken
impl UnwindSafe for IdentToken
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