[][src]Struct permutation_iterator::Permutor

pub struct Permutor { /* fields omitted */ }

Permutor gives you back a permutation iterator that returns a random permutation over [0, max) (0 inclusive to max exclusive).

Examples

Permutor can be used to iterate over a random permutation of integers [0..max) (0 inclusive to max exclusive):

use crate::permutation_iterator::Permutor;
use std::collections::HashSet;

let max: u64 = 10;
let permutor = Permutor::new(max);
for value in permutor {
    println!("{}", value);
}

Methods

impl Permutor[src]

Important traits for Permutor
pub fn new_with_u64_key(max: u64, key: u64) -> Permutor[src]

Important traits for Permutor
pub fn new_with_slice_key(max: u64, key: [u8; 32]) -> Permutor[src]

Important traits for Permutor
pub fn new(max: u64) -> Permutor[src]

Trait Implementations

impl Iterator for Permutor[src]

type Item = u64

The type of the elements being iterated over.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<I> IteratorRandom for I where
    I: Iterator
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,