pub struct SpannedToken<T> {
pub span: Span,
pub token: T,
}Expand description
A source token with attached span
Fields§
§span: Spanthe span of the token
token: Tthe token
Implementations§
Source§impl SpannedToken<Token<'_>>
impl SpannedToken<Token<'_>>
Sourcepub fn into_owned(self) -> SpannedToken<Token<'static>>
pub fn into_owned(self) -> SpannedToken<Token<'static>>
Create an owned version of the token
Source§impl<T> SpannedToken<T>
impl<T> SpannedToken<T>
Sourcepub fn new(span: Span, token: T) -> Self
pub fn new(span: Span, token: T) -> Self
Create a SpannedToken from Span and token
Trait Implementations§
Source§impl<T: Clone> Clone for SpannedToken<T>
impl<T: Clone> Clone for SpannedToken<T>
Source§fn clone(&self) -> SpannedToken<T>
fn clone(&self) -> SpannedToken<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for SpannedToken<T>
impl<T: Debug> Debug for SpannedToken<T>
Source§impl<T: PartialEq> PartialEq<T> for SpannedToken<T>
impl<T: PartialEq> PartialEq<T> for SpannedToken<T>
Source§impl<T: PartialEq> PartialEq for SpannedToken<T>
impl<T: PartialEq> PartialEq for SpannedToken<T>
impl<T> StructuralPartialEq for SpannedToken<T>
Auto Trait Implementations§
impl<T> Freeze for SpannedToken<T>where
T: Freeze,
impl<T> RefUnwindSafe for SpannedToken<T>where
T: RefUnwindSafe,
impl<T> Send for SpannedToken<T>where
T: Send,
impl<T> Sync for SpannedToken<T>where
T: Sync,
impl<T> Unpin for SpannedToken<T>where
T: Unpin,
impl<T> UnwindSafe for SpannedToken<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
Invokes
WrappingSpan::make_wrapped to wrap an AST node in a span.