[][src]Trait proc_quote::Repeat

pub trait Repeat<T: Iterator>: Sealed<T> { }

Defines the behavior of types that can be interpolated inside repeating patterns (#(...)*).

Which types do Repeat

Which types do NOT Repeat

  • IntoIterator, to avoid ambiguity (Ex. "Which behavior would have been used for Vec, which implements both IntoIterator and Borrow<[T]>?"; "Which behavior would have been used for [TokenStream], which implements both IntoIterator and ToTokens?"). To use the iterator, you may call IntoIterator::into_iter explicitly.
  • Ambiguous types that implement at least two of the Repeat traits. In the very unlikely case this happens, disambiguate the type by wrapping it under some structure that only implements the trait you desire to use.

Implementations on Foreign Types

impl<'a, T: 'a, S: Borrow<[T]>> Repeat<Iter<'a, T>> for &'a S[src]

Types that implement Borrow<[T]> may be used in repeating patterns.

This includes, but is not necessarily limited to, Vec, array and slice.

They, will not be consumed. Instead slice::iter will be implicitly called.

impl<'a, T: ToTokens + 'a> Repeat<ToTokensRepeat<'a, T>> for &'a T[src]

Types that implement ToTokens may be used in repeating patterns.

The variable will be interpolated in every iteration.

Loading content...

Implementors

impl<T, I: Iterator<Item = T>> Repeat<I> for I[src]

Types that implement Iterator may be used in repeating patterns.

They, will be consumed, so they can only be used in one pattern.

Loading content...