Trait rand_pop::RandPop
[−]
[src]
pub trait RandPop: Sized { type Item; fn rand_pop<R: Rng>(&mut self, rng: &mut R) -> Option<Self::Item>; fn rand_iter<R: Rng>(self, rng: &mut R) -> RandIter<Self, R> { ... } }
Interface for randomly removing elements from a container.
Associated Types
type Item
Type of the item that's removed from the container.
Required Methods
fn rand_pop<R: Rng>(&mut self, rng: &mut R) -> Option<Self::Item>
Randomly removes an item from the container; does not necessarily preserve order.
Provided Methods
fn rand_iter<R: Rng>(self, rng: &mut R) -> RandIter<Self, R>
Randomly iterates through the items in this container, consuming the container.
Implementors
impl<T> RandPop for Vec<T>