Struct TokenCmpWrapper

Source
#[repr(transparent)]
pub struct TokenCmpWrapper<T: ToTokens>(pub T);

Tuple Fields§

§0: T

Trait Implementations§

Source§

impl<T> Deref for TokenCmpWrapper<T>
where T: ToTokens,

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'a, U> From<&'a U> for &'a TokenCmpWrapper<StaticTid<U>>
where U: ToTokens,

Source§

fn from(value: &'a U) -> Self

Converts to this type from the input type.
Source§

impl<'a, U> From<&'a U> for &'a TokenCmpWrapper<U>
where U: ToTokens,

Source§

fn from(value: &'a U) -> Self

Converts to this type from the input type.
Source§

impl<'a, U> From<&'a mut U> for &'a mut TokenCmpWrapper<StaticTid<U>>
where U: ToTokens,

Source§

fn from(value: &'a mut U) -> Self

Converts to this type from the input type.
Source§

impl<'a, U> From<&'a mut U> for &'a mut TokenCmpWrapper<U>
where U: ToTokens,

Source§

fn from(value: &'a mut U) -> Self

Converts to this type from the input type.
Source§

impl<U> From<U> for TokenCmpWrapper<StaticTid<U>>
where U: ToTokens,

Source§

fn from(value: U) -> Self

Converts to this type from the input type.
Source§

impl<U> From<U> for TokenCmpWrapper<U>
where U: ToTokens,

Source§

fn from(value: U) -> Self

Converts to this type from the input type.
Source§

impl<'a> Generatable<'a, TokenCmpWrapper<StaticTid<Ident>>> for Type<'a>

Source§

const EMITS_NON_CONSTANT_CODE: bool = true

Set this to true when any of the emitted code may be non-constant
Source§

type GeneratableData = Ident

The type of any data passed from the Generatable stage to proceeding stages.
Source§

type TemplateData = ()

The type of any data passed from the Template stage to proceeding stages.
Source§

fn generatable(_: &mut Context<'_>) -> PassedData<Self::GeneratableData>

This is the method the Generatable stage is composed of. Should return Tokens (if any) generated by this stage, plus optionally any data passed to preceding stages.
Source§

fn assert( &self, _context: &mut Context<'_>, (assert_type_eq, _): (&Self::GeneratableData, &Self::TemplateData), to_assert: &TokenCmpWrapper<StaticTid<Ident>>, ) -> Option<TokenStream>

This is the method the Assert stage is composed of. Should return Tokens generated by this stage.
Source§

fn template( &self, _context: &mut Context<'_>, _passed: &Self::GeneratableData, ) -> PassedData<Self::TemplateData>
where Self::TemplateData: Default,

This is the method the Template stage is composed of. Should return Tokens (if any) generated by this stage, plus optionally any data passed to preceding stages.
Source§

impl<'a> Generatable<'a, TokenCmpWrapper<Type>> for Trait<'a>

Source§

const EMITS_NON_CONSTANT_CODE: bool = false

Set this to true when any of the emitted code may be non-constant
Source§

type GeneratableData = ()

The type of any data passed from the Generatable stage to proceeding stages.
Source§

type TemplateData = Ident

The type of any data passed from the Template stage to proceeding stages.
Source§

fn template( &self, _: &mut Context<'_>, _passed: &Self::GeneratableData, ) -> PassedData<Self::TemplateData>

This is the method the Template stage is composed of. Should return Tokens (if any) generated by this stage, plus optionally any data passed to preceding stages.
Source§

fn assert( &self, _context: &mut Context<'_>, (_, assert_trait_bound): (&Self::GeneratableData, &Self::TemplateData), to_assert: &TokenCmpWrapper<Type>, ) -> Option<TokenStream>

This is the method the Assert stage is composed of. Should return Tokens generated by this stage.
Source§

fn generatable(_context: &mut Context<'_>) -> PassedData<Self::GeneratableData>
where Self: Sized,

This is the method the Generatable stage is composed of. Should return Tokens (if any) generated by this stage, plus optionally any data passed to preceding stages.
Source§

impl<'a> Generatable<'a, TokenCmpWrapper<Type>> for Type<'a>

Source§

const EMITS_NON_CONSTANT_CODE: bool = false

Set this to true when any of the emitted code may be non-constant
Source§

type GeneratableData = Ident

The type of any data passed from the Generatable stage to proceeding stages.
Source§

type TemplateData = ()

The type of any data passed from the Template stage to proceeding stages.
Source§

fn generatable(_: &mut Context<'_>) -> PassedData<Self::GeneratableData>

This is the method the Generatable stage is composed of. Should return Tokens (if any) generated by this stage, plus optionally any data passed to preceding stages.
Source§

fn assert( &self, _context: &mut Context<'_>, (assert_type_eq, _): (&Self::GeneratableData, &Self::TemplateData), to_assert: &TokenCmpWrapper<Type>, ) -> Option<TokenStream>

This is the method the Assert stage is composed of. Should return Tokens generated by this stage.
Source§

fn template( &self, _context: &mut Context<'_>, _passed: &Self::GeneratableData, ) -> PassedData<Self::TemplateData>
where Self::TemplateData: Default,

This is the method the Template stage is composed of. Should return Tokens (if any) generated by this stage, plus optionally any data passed to preceding stages.
Source§

impl<T> Ord for TokenCmpWrapper<T>
where T: ToTokens,

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<T, U> PartialEq<TokenCmpWrapper<U>> for TokenCmpWrapper<T>
where T: ToTokens, U: ToTokens,

Source§

fn eq(&self, other: &TokenCmpWrapper<U>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> PartialOrd for TokenCmpWrapper<T>
where T: ToTokens,

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T> ToTokens for TokenCmpWrapper<T>
where T: ToTokens,

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
Source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
Source§

fn into_token_stream(self) -> TokenStream
where Self: Sized,

Convert self directly into a TokenStream object. Read more
Source§

impl<T> Eq for TokenCmpWrapper<T>
where T: ToTokens,

Source§

impl<'a, T> TidAble<'a> for TokenCmpWrapper<T>
where T: ToTokens + 'static,

Auto Trait Implementations§

§

impl<T> Freeze for TokenCmpWrapper<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for TokenCmpWrapper<T>
where T: RefUnwindSafe,

§

impl<T> Send for TokenCmpWrapper<T>
where T: Send,

§

impl<T> Sync for TokenCmpWrapper<T>
where T: Sync,

§

impl<T> Unpin for TokenCmpWrapper<T>
where T: Unpin,

§

impl<T> UnwindSafe for TokenCmpWrapper<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyExt for T
where T: Any + ?Sized,

Source§

fn downcast_ref<T>(this: &Self) -> Option<&T>
where T: Any,

Attempts to downcast this to T behind reference
Source§

fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>
where T: Any,

Attempts to downcast this to T behind mutable reference
Source§

fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>
where T: Any,

Attempts to downcast this to T behind Rc pointer
Source§

fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>
where T: Any,

Attempts to downcast this to T behind Arc pointer
Source§

fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>
where T: Any,

Attempts to downcast this to T behind Box pointer
Source§

fn downcast_move<T>(this: Self) -> Option<T>
where T: Any, Self: Sized,

Attempts to downcast owned Self to T, useful only in generic context as a workaround for specialization
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<'a, T, U> ResolveBounds<'a, T> for U
where T: AssertableWithBounds<'a, U> + 'a,

Source§

fn resolve_for( self, assertable: impl Into<MaybeBorrowed<'a, T>>, ) -> ResolvedBounds<'a, U, T>

Source§

impl<T> Spanned for T
where T: Spanned + ?Sized,

Source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree node, or Span::call_site() if this node is empty.
Source§

impl<'a, T> Tid<'a> for T
where T: TidAble<'a> + ?Sized,

Source§

fn self_id(&self) -> TypeId

Returns type id of the type of self Read more
Source§

fn id() -> TypeId

Returns type id of this type
Source§

impl<'a, X> TidExt<'a> for X
where X: Tid<'a> + ?Sized,

Source§

fn is<T>(&self) -> bool
where T: Tid<'a>,

Returns true if type behind self is equal to the type of T.
Source§

fn downcast_ref<'b, T>(&'b self) -> Option<&'b T>
where T: Tid<'a>,

Attempts to downcast self to T behind reference
Source§

fn downcast_mut<'b, T>(&'b mut self) -> Option<&'b mut T>
where T: Tid<'a>,

Attempts to downcast self to T behind mutable reference
Source§

fn downcast_rc<T>(self: Rc<Self>) -> Result<Rc<T>, Rc<Self>>
where T: Tid<'a>,

Attempts to downcast self to T behind Rc pointer
Source§

fn downcast_arc<T>(self: Arc<Self>) -> Result<Arc<T>, Arc<Self>>
where T: Tid<'a>,

Attempts to downcast self to T behind Arc pointer
Source§

fn downcast_box<T>(self: Box<Self>) -> Result<Box<T>, Box<Self>>
where T: Tid<'a>,

Attempts to downcast self to T behind Box pointer
Source§

fn downcast_move<T>(self) -> Option<T>
where T: Tid<'a>, Self: Sized,

Attempts to downcast owned Self to T, useful only in generic context as a workaround for specialization
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TypeEq for T
where T: ?Sized,

Source§

type This = T