[−][src]Function rand::seq::sample_slice
pub fn sample_slice<R: ?Sized, T>(
rng: &mut R,
slice: &[T],
amount: usize
) -> Vec<T> where
R: Rng,
T: Clone,
Deprecated since 0.6.0:
use SliceRandom::choose_multiple instead
Randomly sample exactly amount
values from slice
.
The values are non-repeating and in random order.
This implementation uses O(amount)
time and memory.
Panics if amount > slice.len()
Deprecated: use [SliceRandom::choose_multiple
] instead.