pub trait ShuffledIterGen<T>: Rng {
type Iter: Iterator;
// Required method
fn iter_shuffled(&mut self, _: T) -> Self::Iter;
}Expand description
This trait may be used to obtain an instance of ShuffledIter. It should
always be implemented generically for all types implementing rand::Rng,
that is for all random number generators (which is the case for this library).
As such, an instance of ShuffledIter may be obtained by calling iter_shuffled
with a suitable argument on any random number generator, given that ShuffledIterGen
is in scope.
An implementation of this trait is provided by this library for the following agument types:
- all ranges of integer types (ie.
0i8..,..10u16,10..20) - slices of any kind
Required Associated Types§
Required Methods§
fn iter_shuffled(&mut self, _: T) -> Self::Iter
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.