Trait quote::ToTokens [−][src]
Types that can be interpolated inside a quote!(...)
invocation.
Required Methods
fn to_tokens(&self, _: &mut Tokens)
Write self
to the given Tokens
.
Example implementation for a struct representing Rust paths like
std::cmp::PartialEq
:
ⓘThis example is not tested
pub struct Path { pub global: bool, pub segments: Vec<PathSegment>, } impl ToTokens for Path { fn to_tokens(&self, tokens: &mut Tokens) { for (i, segment) in self.segments.iter().enumerate() { if i > 0 || self.global { tokens.append("::"); } segment.to_tokens(tokens); } } }
Implementations on Foreign Types
impl<'a, T: ?Sized + ToTokens> ToTokens for &'a T
[src]
impl<'a, T: ?Sized + ToTokens> ToTokens for &'a T
impl<'a, T: ?Sized + ToOwned + ToTokens> ToTokens for Cow<'a, T>
[src]
impl<'a, T: ?Sized + ToOwned + ToTokens> ToTokens for Cow<'a, T>
impl<T: ?Sized + ToTokens> ToTokens for Box<T>
[src]
impl<T: ?Sized + ToTokens> ToTokens for Box<T>
impl<T: ToTokens> ToTokens for Option<T>
[src]
impl<T: ToTokens> ToTokens for Option<T>
impl ToTokens for str
[src]
impl ToTokens for str
impl ToTokens for String
[src]
impl ToTokens for String
impl ToTokens for char
[src]
impl ToTokens for char
impl ToTokens for bool
[src]
impl ToTokens for bool
impl ToTokens for i8
[src]
impl ToTokens for i8
impl ToTokens for i16
[src]
impl ToTokens for i16
impl ToTokens for i32
[src]
impl ToTokens for i32
impl ToTokens for i64
[src]
impl ToTokens for i64
impl ToTokens for isize
[src]
impl ToTokens for isize
impl ToTokens for u8
[src]
impl ToTokens for u8
impl ToTokens for u16
[src]
impl ToTokens for u16
impl ToTokens for u32
[src]
impl ToTokens for u32
impl ToTokens for u64
[src]
impl ToTokens for u64
impl ToTokens for usize
[src]
impl ToTokens for usize
impl ToTokens for f32
[src]
impl ToTokens for f32
impl ToTokens for f64
[src]
impl ToTokens for f64
impl<T: ToTokens> ToTokens for [T]
[src]
impl<T: ToTokens> ToTokens for [T]
impl<T: ToTokens> ToTokens for Vec<T>
[src]
impl<T: ToTokens> ToTokens for Vec<T>
impl<T: ToTokens> ToTokens for [T; 0]
[src]
impl<T: ToTokens> ToTokens for [T; 0]
impl<T: ToTokens> ToTokens for [T; 1]
[src]
impl<T: ToTokens> ToTokens for [T; 1]
impl<T: ToTokens> ToTokens for [T; 2]
[src]
impl<T: ToTokens> ToTokens for [T; 2]
impl<T: ToTokens> ToTokens for [T; 3]
[src]
impl<T: ToTokens> ToTokens for [T; 3]
impl<T: ToTokens> ToTokens for [T; 4]
[src]
impl<T: ToTokens> ToTokens for [T; 4]
impl<T: ToTokens> ToTokens for [T; 5]
[src]
impl<T: ToTokens> ToTokens for [T; 5]
impl<T: ToTokens> ToTokens for [T; 6]
[src]
impl<T: ToTokens> ToTokens for [T; 6]
impl<T: ToTokens> ToTokens for [T; 7]
[src]
impl<T: ToTokens> ToTokens for [T; 7]
impl<T: ToTokens> ToTokens for [T; 8]
[src]
impl<T: ToTokens> ToTokens for [T; 8]
impl<T: ToTokens> ToTokens for [T; 9]
[src]
impl<T: ToTokens> ToTokens for [T; 9]
impl<T: ToTokens> ToTokens for [T; 10]
[src]
impl<T: ToTokens> ToTokens for [T; 10]
impl<T: ToTokens> ToTokens for [T; 11]
[src]
impl<T: ToTokens> ToTokens for [T; 11]
impl<T: ToTokens> ToTokens for [T; 12]
[src]
impl<T: ToTokens> ToTokens for [T; 12]
impl<T: ToTokens> ToTokens for [T; 13]
[src]
impl<T: ToTokens> ToTokens for [T; 13]
impl<T: ToTokens> ToTokens for [T; 14]
[src]
impl<T: ToTokens> ToTokens for [T; 14]
impl<T: ToTokens> ToTokens for [T; 15]
[src]
impl<T: ToTokens> ToTokens for [T; 15]
impl<T: ToTokens> ToTokens for [T; 16]
[src]
impl<T: ToTokens> ToTokens for [T; 16]
impl<T: ToTokens> ToTokens for [T; 17]
[src]
impl<T: ToTokens> ToTokens for [T; 17]
impl<T: ToTokens> ToTokens for [T; 18]
[src]
impl<T: ToTokens> ToTokens for [T; 18]
impl<T: ToTokens> ToTokens for [T; 19]
[src]
impl<T: ToTokens> ToTokens for [T; 19]
impl<T: ToTokens> ToTokens for [T; 20]
[src]
impl<T: ToTokens> ToTokens for [T; 20]
impl<T: ToTokens> ToTokens for [T; 21]
[src]
impl<T: ToTokens> ToTokens for [T; 21]
impl<T: ToTokens> ToTokens for [T; 22]
[src]
impl<T: ToTokens> ToTokens for [T; 22]
impl<T: ToTokens> ToTokens for [T; 23]
[src]
impl<T: ToTokens> ToTokens for [T; 23]
impl<T: ToTokens> ToTokens for [T; 24]
[src]
impl<T: ToTokens> ToTokens for [T; 24]
impl<T: ToTokens> ToTokens for [T; 25]
[src]
impl<T: ToTokens> ToTokens for [T; 25]
impl<T: ToTokens> ToTokens for [T; 26]
[src]
impl<T: ToTokens> ToTokens for [T; 26]
impl<T: ToTokens> ToTokens for [T; 27]
[src]
impl<T: ToTokens> ToTokens for [T; 27]
impl<T: ToTokens> ToTokens for [T; 28]
[src]
impl<T: ToTokens> ToTokens for [T; 28]
impl<T: ToTokens> ToTokens for [T; 29]
[src]
impl<T: ToTokens> ToTokens for [T; 29]
impl<T: ToTokens> ToTokens for [T; 30]
[src]
impl<T: ToTokens> ToTokens for [T; 30]
impl<T: ToTokens> ToTokens for [T; 31]
[src]
impl<T: ToTokens> ToTokens for [T; 31]
impl<T: ToTokens> ToTokens for [T; 32]
[src]
impl<T: ToTokens> ToTokens for [T; 32]
impl ToTokens for ()
[src]
impl ToTokens for ()
impl<A: ToTokens> ToTokens for (A,)
[src]
impl<A: ToTokens> ToTokens for (A,)
impl<A: ToTokens, B: ToTokens> ToTokens for (A, B)
[src]
impl<A: ToTokens, B: ToTokens> ToTokens for (A, B)
impl<A: ToTokens, B: ToTokens, C: ToTokens> ToTokens for (A, B, C)
[src]
impl<A: ToTokens, B: ToTokens, C: ToTokens> ToTokens for (A, B, C)
impl<A: ToTokens, B: ToTokens, C: ToTokens, D: ToTokens> ToTokens for (A, B, C, D)
[src]
impl<A: ToTokens, B: ToTokens, C: ToTokens, D: ToTokens> ToTokens for (A, B, C, D)
impl<A: ToTokens, B: ToTokens, C: ToTokens, D: ToTokens, E: ToTokens> ToTokens for (A, B, C, D, E)
[src]
impl<A: ToTokens, B: ToTokens, C: ToTokens, D: ToTokens, E: ToTokens> ToTokens for (A, B, C, D, E)
impl<A: ToTokens, B: ToTokens, C: ToTokens, D: ToTokens, E: ToTokens, F: ToTokens> ToTokens for (A, B, C, D, E, F)
[src]
impl<A: ToTokens, B: ToTokens, C: ToTokens, D: ToTokens, E: ToTokens, F: ToTokens> ToTokens for (A, B, C, D, E, F)
impl<A: ToTokens, B: ToTokens, C: ToTokens, D: ToTokens, E: ToTokens, F: ToTokens, G: ToTokens> ToTokens for (A, B, C, D, E, F, G)
[src]
impl<A: ToTokens, B: ToTokens, C: ToTokens, D: ToTokens, E: ToTokens, F: ToTokens, G: ToTokens> ToTokens for (A, B, C, D, E, F, G)
impl<A: ToTokens, B: ToTokens, C: ToTokens, D: ToTokens, E: ToTokens, F: ToTokens, G: ToTokens, H: ToTokens> ToTokens for (A, B, C, D, E, F, G, H)
[src]
impl<A: ToTokens, B: ToTokens, C: ToTokens, D: ToTokens, E: ToTokens, F: ToTokens, G: ToTokens, H: ToTokens> ToTokens for (A, B, C, D, E, F, G, H)
impl<A: ToTokens, B: ToTokens, C: ToTokens, D: ToTokens, E: ToTokens, F: ToTokens, G: ToTokens, H: ToTokens, I: ToTokens> ToTokens for (A, B, C, D, E, F, G, H, I)
[src]
impl<A: ToTokens, B: ToTokens, C: ToTokens, D: ToTokens, E: ToTokens, F: ToTokens, G: ToTokens, H: ToTokens, I: ToTokens> ToTokens for (A, B, C, D, E, F, G, H, I)
impl<A: ToTokens, B: ToTokens, C: ToTokens, D: ToTokens, E: ToTokens, F: ToTokens, G: ToTokens, H: ToTokens, I: ToTokens, J: ToTokens> ToTokens for (A, B, C, D, E, F, G, H, I, J)
[src]
impl<A: ToTokens, B: ToTokens, C: ToTokens, D: ToTokens, E: ToTokens, F: ToTokens, G: ToTokens, H: ToTokens, I: ToTokens, J: ToTokens> ToTokens for (A, B, C, D, E, F, G, H, I, J)
impl<A: ToTokens, B: ToTokens, C: ToTokens, D: ToTokens, E: ToTokens, F: ToTokens, G: ToTokens, H: ToTokens, I: ToTokens, J: ToTokens, K: ToTokens> ToTokens for (A, B, C, D, E, F, G, H, I, J, K)
[src]
impl<A: ToTokens, B: ToTokens, C: ToTokens, D: ToTokens, E: ToTokens, F: ToTokens, G: ToTokens, H: ToTokens, I: ToTokens, J: ToTokens, K: ToTokens> ToTokens for (A, B, C, D, E, F, G, H, I, J, K)
impl<A: ToTokens, B: ToTokens, C: ToTokens, D: ToTokens, E: ToTokens, F: ToTokens, G: ToTokens, H: ToTokens, I: ToTokens, J: ToTokens, K: ToTokens, L: ToTokens> ToTokens for (A, B, C, D, E, F, G, H, I, J, K, L)
[src]
impl<A: ToTokens, B: ToTokens, C: ToTokens, D: ToTokens, E: ToTokens, F: ToTokens, G: ToTokens, H: ToTokens, I: ToTokens, J: ToTokens, K: ToTokens, L: ToTokens> ToTokens for (A, B, C, D, E, F, G, H, I, J, K, L)
Implementors
impl<'a> ToTokens for ByteStr<'a>
impl ToTokens for Tokens
impl ToTokens for Hex<i8>
impl ToTokens for Hex<i16>
impl ToTokens for Hex<i32>
impl ToTokens for Hex<i64>
impl ToTokens for Hex<isize>
impl ToTokens for Hex<u8>
impl ToTokens for Hex<u16>
impl ToTokens for Hex<u32>
impl ToTokens for Hex<u64>
impl ToTokens for Hex<usize>
impl ToTokens for Ident