Skip to main content

WithSpan

Trait WithSpan 

Source
pub trait WithSpan: IntoTokens + WithSpan {
    type WithDefaultSpan<S: Span>: IntoTokens + WithSpan;
    type WithReplacedSpan<S: Span>: IntoTokens + WithSpan;

    // Required methods
    fn with_default_span<S: Span>(self, span: S) -> Self::WithDefaultSpan<S>;
    fn with_replaced_span<S: Span>(self, span: S) -> Self::WithReplacedSpan<S>;
}
Expand description

Into tokens with new span.

This trait is sealed and all methods are provided.

Required Associated Types§

Required Methods§

Source

fn with_default_span<S: Span>(self, span: S) -> Self::WithDefaultSpan<S>

Source

fn with_replaced_span<S: Span>(self, span: S) -> Self::WithReplacedSpan<S>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl WithSpan for TT

Available on crate feature proc-macro and (crate features proc-macro or proc-macro2) only.
Source§

type WithDefaultSpan<S: Span> = TokenTree

Source§

type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<TokenTree>>::ReplaceSpanOf

Source§

fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>

Source§

fn with_replaced_span<S: Span>(self, span: S) -> Self::WithReplacedSpan<S>

Source§

impl WithSpan for TT

Available on crate feature proc-macro2 and (crate features proc-macro or proc-macro2) only.
Source§

type WithDefaultSpan<S: Span> = TokenTree

Source§

type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<TokenTree>>::ReplaceSpanOf

Source§

fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>

Source§

fn with_replaced_span<S: Span>(self, span: S) -> Self::WithReplacedSpan<S>

Source§

impl WithSpan for TT

Available on crate feature proc-macro and (crate features proc-macro or proc-macro2) only.
Source§

type WithDefaultSpan<S: Span> = Group

Source§

type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<Group>>::ReplaceSpanOf

Source§

fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>

Source§

fn with_replaced_span<S: Span>(self, span: S) -> Self::WithReplacedSpan<S>

Source§

impl WithSpan for TT

Available on crate feature proc-macro and (crate features proc-macro or proc-macro2) only.
Source§

type WithDefaultSpan<S: Span> = Ident

Source§

type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<Ident>>::ReplaceSpanOf

Source§

fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>

Source§

fn with_replaced_span<S: Span>(self, span: S) -> Self::WithReplacedSpan<S>

Source§

impl WithSpan for TT

Available on crate feature proc-macro and (crate features proc-macro or proc-macro2) only.
Source§

type WithDefaultSpan<S: Span> = Literal

Source§

type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<Literal>>::ReplaceSpanOf

Source§

fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>

Source§

fn with_replaced_span<S: Span>(self, span: S) -> Self::WithReplacedSpan<S>

Source§

impl WithSpan for TT

Available on crate feature proc-macro and (crate features proc-macro or proc-macro2) only.
Source§

type WithDefaultSpan<S: Span> = Punct

Source§

type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<Punct>>::ReplaceSpanOf

Source§

fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>

Source§

fn with_replaced_span<S: Span>(self, span: S) -> Self::WithReplacedSpan<S>

Source§

impl WithSpan for TokenStream

Available on crate feature proc-macro and (crate features proc-macro or proc-macro2) only.
Source§

type WithDefaultSpan<S: Span> = TokenStream

Source§

type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<TokenStream>>::ReplaceSpanOf

Source§

fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>

Source§

fn with_replaced_span<S: Span>(self, span: S) -> Self::WithReplacedSpan<S>

Source§

impl WithSpan for TT

Available on crate feature proc-macro2 and (crate features proc-macro or proc-macro2) only.
Source§

type WithDefaultSpan<S: Span> = Group

Source§

type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<Group>>::ReplaceSpanOf

Source§

fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>

Source§

fn with_replaced_span<S: Span>(self, span: S) -> Self::WithReplacedSpan<S>

Source§

impl WithSpan for TT

Available on crate feature proc-macro2 and (crate features proc-macro or proc-macro2) only.
Source§

type WithDefaultSpan<S: Span> = Ident

Source§

type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<Ident>>::ReplaceSpanOf

Source§

fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>

Source§

fn with_replaced_span<S: Span>(self, span: S) -> Self::WithReplacedSpan<S>

Source§

impl WithSpan for TT

Available on crate feature proc-macro2 and (crate features proc-macro or proc-macro2) only.
Source§

type WithDefaultSpan<S: Span> = Literal

Source§

type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<Literal>>::ReplaceSpanOf

Source§

fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>

Source§

fn with_replaced_span<S: Span>(self, span: S) -> Self::WithReplacedSpan<S>

Source§

impl WithSpan for TT

Available on crate feature proc-macro2 and (crate features proc-macro or proc-macro2) only.
Source§

type WithDefaultSpan<S: Span> = Punct

Source§

type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<Punct>>::ReplaceSpanOf

Source§

fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>

Source§

fn with_replaced_span<S: Span>(self, span: S) -> Self::WithReplacedSpan<S>

Source§

impl WithSpan for TokenStream

Available on crate feature proc-macro2 and (crate features proc-macro or proc-macro2) only.
Source§

type WithDefaultSpan<S: Span> = TokenStream

Source§

type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<TokenStream>>::ReplaceSpanOf

Source§

fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>

Source§

fn with_replaced_span<S: Span>(self, span: S) -> Self::WithReplacedSpan<S>

Source§

impl<'a, T: ?Sized + RefWithSpan> WithSpan for &'a T

Source§

impl<T: WithSpan> WithSpan for Option<T>

Implementors§

Source§

impl WithSpan for Never

Source§

impl WithSpan for Empty

Source§

impl<'a, SO: MaybeSpan> WithSpan for Ident<'a, SO>

Source§

impl<'a, SO: MaybeSpan> WithSpan for Lifetime<'a, SO>

Source§

impl<'a, SO: MaybeSpan> WithSpan for Literal<'a, SO>

Source§

impl<A: WithSpan, B: WithSpan> WithSpan for Either<A, B>

Source§

impl<A: WithSpan, B: WithSpan> WithSpan for Concat<A, B>

Source§

impl<A: WithSpan, B: WithSpan, SO: Span> WithSpan for ConcatWithDefaultSpan<A, B, SO>

Source§

impl<A: WithSpan, B: WithSpan, SO: Span> WithSpan for ConcatWithReplacedSpan<A, B, SO>

Source§

impl<I: IntoIterator<Item: IntoTokens + WithSpan>> WithSpan for IterTokens<I>

Source§

impl<I: IntoIterator<Item: IntoTokens + WithSpan>, SO: Span> WithSpan for IterTokensWithDefaultSpan<I, SO>

Source§

impl<I: IntoIterator<Item: IntoTokens + WithSpan>, SO: Span> WithSpan for IterTokensWithReplacedSpan<I, SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Add<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::And<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::At<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Bang<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Caret<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Colon<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Comma<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Div<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Dollar<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Dot<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Eq<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Gt<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Lt<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Or<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Pound<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Question<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Rem<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Semi<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Star<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Sub<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::punct::Tilde<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::AddEq<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::AndAnd<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::AndEq<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::CaretEq<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::Colon2<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::DivEq<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::Dot2<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::Dot3<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::DotDotEq<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::EqEq<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::FatArrow<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::Ge<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::LArrow<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::Le<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::MulEq<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::Ne<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::OrEq<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::OrOr<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::RArrow<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::RemEq<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::Shl<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::ShlEq<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::Shr<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::ShrEq<SO>

Source§

impl<SO: MaybeSpan> WithSpan for typed_quote::tokens::puncts::SubEq<SO>

Source§

impl<T: HasConstIdent + ?Sized, SO: MaybeSpan> WithSpan for ConstIdent<T, SO>

Source§

impl<T: HasConstLifetime + ?Sized, SO: MaybeSpan> WithSpan for ConstLifetime<T, SO>

Source§

impl<T: HasConstLiteral + ?Sized, SO: MaybeSpan> WithSpan for ConstLiteral<T, SO>

Source§

impl<T: IntoTokens + WithSpan, SO: MaybeSpan> WithSpan for typed_quote::tokens::Brace<T, SO>

Source§

impl<T: IntoTokens + WithSpan, SO: MaybeSpan> WithSpan for typed_quote::tokens::Bracket<T, SO>

Source§

impl<T: IntoTokens + WithSpan, SO: MaybeSpan> WithSpan for typed_quote::tokens::Parenthesis<T, SO>