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§
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>
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.
impl WithSpan for TT
Available on crate feature
proc-macro and (crate features proc-macro or proc-macro2) only.type WithDefaultSpan<S: Span> = TokenTree
type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<TokenTree>>::ReplaceSpanOf
fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>
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.
impl WithSpan for TT
Available on crate feature
proc-macro2 and (crate features proc-macro or proc-macro2) only.type WithDefaultSpan<S: Span> = TokenTree
type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<TokenTree>>::ReplaceSpanOf
fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>
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.
impl WithSpan for TT
Available on crate feature
proc-macro and (crate features proc-macro or proc-macro2) only.type WithDefaultSpan<S: Span> = Group
type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<Group>>::ReplaceSpanOf
fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>
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.
impl WithSpan for TT
Available on crate feature
proc-macro and (crate features proc-macro or proc-macro2) only.type WithDefaultSpan<S: Span> = Ident
type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<Ident>>::ReplaceSpanOf
fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>
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.
impl WithSpan for TT
Available on crate feature
proc-macro and (crate features proc-macro or proc-macro2) only.type WithDefaultSpan<S: Span> = Literal
type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<Literal>>::ReplaceSpanOf
fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>
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.
impl WithSpan for TT
Available on crate feature
proc-macro and (crate features proc-macro or proc-macro2) only.type WithDefaultSpan<S: Span> = Punct
type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<Punct>>::ReplaceSpanOf
fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>
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.
impl WithSpan for TokenStream
Available on crate feature
proc-macro and (crate features proc-macro or proc-macro2) only.type WithDefaultSpan<S: Span> = TokenStream
type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<TokenStream>>::ReplaceSpanOf
fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>
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.
impl WithSpan for TT
Available on crate feature
proc-macro2 and (crate features proc-macro or proc-macro2) only.type WithDefaultSpan<S: Span> = Group
type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<Group>>::ReplaceSpanOf
fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>
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.
impl WithSpan for TT
Available on crate feature
proc-macro2 and (crate features proc-macro or proc-macro2) only.type WithDefaultSpan<S: Span> = Ident
type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<Ident>>::ReplaceSpanOf
fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>
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.
impl WithSpan for TT
Available on crate feature
proc-macro2 and (crate features proc-macro or proc-macro2) only.type WithDefaultSpan<S: Span> = Literal
type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<Literal>>::ReplaceSpanOf
fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>
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.
impl WithSpan for TT
Available on crate feature
proc-macro2 and (crate features proc-macro or proc-macro2) only.type WithDefaultSpan<S: Span> = Punct
type WithReplacedSpan<S: Span> = <S as ReplaceSpanOf<Punct>>::ReplaceSpanOf
fn with_default_span<S: Span>(self, _: S) -> Self::WithDefaultSpan<S>
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.
impl WithSpan for TokenStream
Available on crate feature
proc-macro2 and (crate features proc-macro or proc-macro2) only.