pub struct Permutation(/* private fields */);
Expand description
A data structure representation a permutation of integers.
Implementations§
Source§impl Permutation
impl Permutation
pub fn from_slice(x: &[usize]) -> Option<Self>
pub fn from_vector(x: Vec<usize>) -> Option<Self>
pub fn natural(n_items: usize) -> Self
pub fn random<T: Rng>(n_items: usize, rng: &mut T) -> Self
pub fn shuffle<T: Rng>(&mut self, rng: &mut T)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn slice_until(&self, end: usize) -> &[usize]
Trait Implementations§
Source§impl Debug for Permutation
impl Debug for Permutation
Auto Trait Implementations§
impl Freeze for Permutation
impl RefUnwindSafe for Permutation
impl Send for Permutation
impl Sync for Permutation
impl Unpin for Permutation
impl UnwindSafe for Permutation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more