pub struct TokenWithMetadata<T, U> {
pub token: T,
pub metadata: U,
}Expand description
A simple struct holding a token and its associated metadata.
Though TokenWithMetadata::token is generic, it should be a token from
proc_macro2 other than Group (Ident, Punct, or Literal).
To get the token without metadata, simply read the
TokenWithMetadata::token field.
Fields§
§token: TThe token.
metadata: UThe associated metadata.
Trait Implementations§
Source§impl<T: Clone, U: Clone> Clone for TokenWithMetadata<T, U>
impl<T: Clone, U: Clone> Clone for TokenWithMetadata<T, U>
Source§fn clone(&self) -> TokenWithMetadata<T, U>
fn clone(&self) -> TokenWithMetadata<T, U>
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<T: Default, U: Default> Default for TokenWithMetadata<T, U>
impl<T: Default, U: Default> Default for TokenWithMetadata<T, U>
Source§fn default() -> TokenWithMetadata<T, U>
fn default() -> TokenWithMetadata<T, U>
Returns the “default value” for a type. Read more
Source§impl<T, U> Deref for TokenWithMetadata<T, U>
Allow accessing the token’s methods directly.
impl<T, U> Deref for TokenWithMetadata<T, U>
Allow accessing the token’s methods directly.
Source§impl<T, U> DerefMut for TokenWithMetadata<T, U>
Allow accessing the token’s methods directly.
impl<T, U> DerefMut for TokenWithMetadata<T, U>
Allow accessing the token’s methods directly.
impl<T: Eq, U: Eq> Eq for TokenWithMetadata<T, U>
Source§impl<T, U> From<(T, U)> for TokenWithMetadata<T, U>
impl<T, U> From<(T, U)> for TokenWithMetadata<T, U>
Source§impl<T, U: Default> From<T> for TokenWithMetadata<T, U>
impl<T, U: Default> From<T> for TokenWithMetadata<T, U>
Source§impl<T: PartialEq, U: PartialEq> PartialEq for TokenWithMetadata<T, U>
impl<T: PartialEq, U: PartialEq> PartialEq for TokenWithMetadata<T, U>
Source§fn eq(&self, other: &TokenWithMetadata<T, U>) -> bool
fn eq(&self, other: &TokenWithMetadata<T, U>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<T, U> StructuralPartialEq for TokenWithMetadata<T, U>
Auto Trait Implementations§
impl<T, U> Freeze for TokenWithMetadata<T, U>
impl<T, U> RefUnwindSafe for TokenWithMetadata<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for TokenWithMetadata<T, U>
impl<T, U> Sync for TokenWithMetadata<T, U>
impl<T, U> Unpin for TokenWithMetadata<T, U>
impl<T, U> UnsafeUnpin for TokenWithMetadata<T, U>where
T: UnsafeUnpin,
U: UnsafeUnpin,
impl<T, U> UnwindSafe for TokenWithMetadata<T, U>where
T: UnwindSafe,
U: 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