pub struct Repeat<T: Clone> { /* private fields */ }
Expand description
Repeat a provided collection.
This is a less flexible, but more concisely constructed, version
of Cycle
that starts from a container instead of an iterator.
Example:
use boulder::{Generator, Repeat};
let mut g = Repeat::new(1..3);
assert_eq!(g.generate(), 1);
assert_eq!(g.generate(), 2);
assert_eq!(g.generate(), 1);
Implementations
Trait Implementations
sourceimpl<C, T> GeneratorWithPersianRug<C> for Repeat<T> where
T: Clone + 'static,
C: Context,
impl<C, T> GeneratorWithPersianRug<C> for Repeat<T> where
T: Clone + 'static,
C: Context,
Auto Trait Implementations
impl<T> RefUnwindSafe for Repeat<T> where
T: RefUnwindSafe,
impl<T> Send for Repeat<T> where
T: Send,
impl<T> Sync for Repeat<T> where
T: Sync,
impl<T> Unpin for Repeat<T> where
T: Unpin,
impl<T> UnwindSafe for Repeat<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more