Trait Shuffle

Source
pub trait Shuffle<T>: RandomContainer<T> + FromIterator<T>
where T: Clone,
{ // Provided methods fn shuffle(&mut self) { ... } fn shuffled(&self) -> Self { ... } }
Expand description

Trait for shuffling a container

Provided Methods§

Source

fn shuffle(&mut self)

Shuffles the container

Source

fn shuffled(&self) -> Self

Returns a shuffled copy of the container

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<T> Shuffle<T> for Vec<T>
where T: Clone,

Source§

fn shuffle(&mut self)

Source§

impl<T> Shuffle<T> for HashSet<T>
where T: Clone + Eq + Hash,

Implementors§