pub trait RefWithSpan:
WithSpan
+ ToTokens
+ RefWithSpan {
type RefWithDefaultSpan<'a, S: Span>: ToTokens + Copy + RefWithSpan
where Self: 'a;
type RefWithReplacedSpan<'a, S: Span>: ToTokens + Copy + RefWithSpan
where Self: 'a;
// Required methods
fn ref_with_default_span<S: Span>(
&self,
span: S,
) -> Self::RefWithDefaultSpan<'_, S>;
fn ref_with_replaced_span<S: Span>(
&self,
span: S,
) -> Self::RefWithReplacedSpan<'_, S>;
}Expand description
To tokens with new span.
This trait is sealed and all methods are provided.
Required Associated Types§
type RefWithDefaultSpan<'a, S: Span>: ToTokens + Copy + RefWithSpan where Self: 'a
type RefWithReplacedSpan<'a, S: Span>: ToTokens + Copy + RefWithSpan where Self: 'a
Required Methods§
fn ref_with_default_span<S: Span>( &self, span: S, ) -> Self::RefWithDefaultSpan<'_, S>
fn ref_with_replaced_span<S: Span>( &self, span: S, ) -> Self::RefWithReplacedSpan<'_, 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 RefWithSpan for TT
Available on crate feature proc-macro and (crate features proc-macro or proc-macro2) only.
impl RefWithSpan for TT
Available on crate feature
proc-macro and (crate features proc-macro or proc-macro2) only.type RefWithDefaultSpan<'a, S: Span> = &'a TokenTree where Self: 'a
type RefWithReplacedSpan<'a, S: Span> = ReplaceSpanOfRef<'a, TokenTree, S> where Self: 'a
fn ref_with_default_span<S: Span>( &self, _: S, ) -> Self::RefWithDefaultSpan<'_, S>
fn ref_with_replaced_span<S: Span>( &self, span: S, ) -> Self::RefWithReplacedSpan<'_, S>
Source§impl RefWithSpan for TT
Available on crate feature proc-macro2 and (crate features proc-macro or proc-macro2) only.
impl RefWithSpan for TT
Available on crate feature
proc-macro2 and (crate features proc-macro or proc-macro2) only.type RefWithDefaultSpan<'a, S: Span> = &'a TokenTree where Self: 'a
type RefWithReplacedSpan<'a, S: Span> = ReplaceSpanOfRef<'a, TokenTree, S> where Self: 'a
fn ref_with_default_span<S: Span>( &self, _: S, ) -> Self::RefWithDefaultSpan<'_, S>
fn ref_with_replaced_span<S: Span>( &self, span: S, ) -> Self::RefWithReplacedSpan<'_, S>
Source§impl RefWithSpan for TT
Available on crate feature proc-macro and (crate features proc-macro or proc-macro2) only.
impl RefWithSpan for TT
Available on crate feature
proc-macro and (crate features proc-macro or proc-macro2) only.type RefWithDefaultSpan<'a, S: Span> = &'a Group where Self: 'a
type RefWithReplacedSpan<'a, S: Span> = ReplaceSpanOfRef<'a, Group, S> where Self: 'a
fn ref_with_default_span<S: Span>( &self, _: S, ) -> Self::RefWithDefaultSpan<'_, S>
fn ref_with_replaced_span<S: Span>( &self, span: S, ) -> Self::RefWithReplacedSpan<'_, S>
Source§impl RefWithSpan for TT
Available on crate feature proc-macro and (crate features proc-macro or proc-macro2) only.
impl RefWithSpan for TT
Available on crate feature
proc-macro and (crate features proc-macro or proc-macro2) only.type RefWithDefaultSpan<'a, S: Span> = &'a Ident where Self: 'a
type RefWithReplacedSpan<'a, S: Span> = ReplaceSpanOfRef<'a, Ident, S> where Self: 'a
fn ref_with_default_span<S: Span>( &self, _: S, ) -> Self::RefWithDefaultSpan<'_, S>
fn ref_with_replaced_span<S: Span>( &self, span: S, ) -> Self::RefWithReplacedSpan<'_, S>
Source§impl RefWithSpan for TT
Available on crate feature proc-macro and (crate features proc-macro or proc-macro2) only.
impl RefWithSpan for TT
Available on crate feature
proc-macro and (crate features proc-macro or proc-macro2) only.type RefWithDefaultSpan<'a, S: Span> = &'a Literal where Self: 'a
type RefWithReplacedSpan<'a, S: Span> = ReplaceSpanOfRef<'a, Literal, S> where Self: 'a
fn ref_with_default_span<S: Span>( &self, _: S, ) -> Self::RefWithDefaultSpan<'_, S>
fn ref_with_replaced_span<S: Span>( &self, span: S, ) -> Self::RefWithReplacedSpan<'_, S>
Source§impl RefWithSpan for TT
Available on crate feature proc-macro and (crate features proc-macro or proc-macro2) only.
impl RefWithSpan for TT
Available on crate feature
proc-macro and (crate features proc-macro or proc-macro2) only.type RefWithDefaultSpan<'a, S: Span> = &'a Punct where Self: 'a
type RefWithReplacedSpan<'a, S: Span> = ReplaceSpanOfRef<'a, Punct, S> where Self: 'a
fn ref_with_default_span<S: Span>( &self, _: S, ) -> Self::RefWithDefaultSpan<'_, S>
fn ref_with_replaced_span<S: Span>( &self, span: S, ) -> Self::RefWithReplacedSpan<'_, S>
Source§impl RefWithSpan for TokenStream
Available on crate feature proc-macro and (crate features proc-macro or proc-macro2) only.
impl RefWithSpan for TokenStream
Available on crate feature
proc-macro and (crate features proc-macro or proc-macro2) only.type RefWithDefaultSpan<'a, S: Span> = &'a TokenStream where Self: 'a
type RefWithReplacedSpan<'a, S: Span> = ReplaceSpanOfRef<'a, TokenStream, S> where Self: 'a
fn ref_with_default_span<S: Span>( &self, _: S, ) -> Self::RefWithDefaultSpan<'_, S>
fn ref_with_replaced_span<S: Span>( &self, span: S, ) -> Self::RefWithReplacedSpan<'_, S>
Source§impl RefWithSpan for TT
Available on crate feature proc-macro2 and (crate features proc-macro or proc-macro2) only.
impl RefWithSpan for TT
Available on crate feature
proc-macro2 and (crate features proc-macro or proc-macro2) only.type RefWithDefaultSpan<'a, S: Span> = &'a Group where Self: 'a
type RefWithReplacedSpan<'a, S: Span> = ReplaceSpanOfRef<'a, Group, S> where Self: 'a
fn ref_with_default_span<S: Span>( &self, _: S, ) -> Self::RefWithDefaultSpan<'_, S>
fn ref_with_replaced_span<S: Span>( &self, span: S, ) -> Self::RefWithReplacedSpan<'_, S>
Source§impl RefWithSpan for TT
Available on crate feature proc-macro2 and (crate features proc-macro or proc-macro2) only.
impl RefWithSpan for TT
Available on crate feature
proc-macro2 and (crate features proc-macro or proc-macro2) only.type RefWithDefaultSpan<'a, S: Span> = &'a Ident where Self: 'a
type RefWithReplacedSpan<'a, S: Span> = ReplaceSpanOfRef<'a, Ident, S> where Self: 'a
fn ref_with_default_span<S: Span>( &self, _: S, ) -> Self::RefWithDefaultSpan<'_, S>
fn ref_with_replaced_span<S: Span>( &self, span: S, ) -> Self::RefWithReplacedSpan<'_, S>
Source§impl RefWithSpan for TT
Available on crate feature proc-macro2 and (crate features proc-macro or proc-macro2) only.
impl RefWithSpan for TT
Available on crate feature
proc-macro2 and (crate features proc-macro or proc-macro2) only.type RefWithDefaultSpan<'a, S: Span> = &'a Literal where Self: 'a
type RefWithReplacedSpan<'a, S: Span> = ReplaceSpanOfRef<'a, Literal, S> where Self: 'a
fn ref_with_default_span<S: Span>( &self, _: S, ) -> Self::RefWithDefaultSpan<'_, S>
fn ref_with_replaced_span<S: Span>( &self, span: S, ) -> Self::RefWithReplacedSpan<'_, S>
Source§impl RefWithSpan for TT
Available on crate feature proc-macro2 and (crate features proc-macro or proc-macro2) only.
impl RefWithSpan for TT
Available on crate feature
proc-macro2 and (crate features proc-macro or proc-macro2) only.type RefWithDefaultSpan<'a, S: Span> = &'a Punct where Self: 'a
type RefWithReplacedSpan<'a, S: Span> = ReplaceSpanOfRef<'a, Punct, S> where Self: 'a
fn ref_with_default_span<S: Span>( &self, _: S, ) -> Self::RefWithDefaultSpan<'_, S>
fn ref_with_replaced_span<S: Span>( &self, span: S, ) -> Self::RefWithReplacedSpan<'_, S>
Source§impl RefWithSpan for TokenStream
Available on crate feature proc-macro2 and (crate features proc-macro or proc-macro2) only.
impl RefWithSpan for TokenStream
Available on crate feature
proc-macro2 and (crate features proc-macro or proc-macro2) only.