pub trait RandomPermutation {
    type Item;

    // Required method
    fn random_permutation<Hashing: Hash>(
        self,
        random: &mut RandomNumberGenerator<Hashing>
    ) -> Option<Vec<Self::Item>>;
}
Expand description

Pseudo-random permutation. It’s as secure as the combination of the seed with which the RandomNumberGenerator is constructed and the hash function it uses to cycle the elements.

Required Associated Types§

Required Methods§

source

fn random_permutation<Hashing: Hash>( self, random: &mut RandomNumberGenerator<Hashing> ) -> Option<Vec<Self::Item>>

Random permutation from an array of elements. This is guaranteed to return Some except in the case that self is empty.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> RandomPermutation for Vec<T>

§

type Item = T

source§

fn random_permutation<Hashing: Hash>( self, random: &mut RandomNumberGenerator<Hashing> ) -> Option<Vec<T>>

Implementors§