Trait zebra_test::prelude::prop::strategy::Shuffleable

pub trait Shuffleable {
    // Required methods
    fn shuffle_len(&self) -> usize;
    fn shuffle_swap(&mut self, a: usize, b: usize);
}
Expand description

A value which can be used with the prop_shuffle combinator.

This is not a general-purpose trait. Its methods are prefixed with shuffle_ to avoid the compiler suggesting them or this trait as corrections in errors.

Required Methods§

fn shuffle_len(&self) -> usize

Return the length of this collection.

fn shuffle_swap(&mut self, a: usize, b: usize)

Swap the elements at the given indices.

Implementations on Foreign Types§

§

impl<T> Shuffleable for [T; 0]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 1]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 2]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 3]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 4]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 5]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 6]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 7]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 8]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 9]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 10]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 11]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 12]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 13]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 14]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 15]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 16]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 17]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 18]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 19]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 20]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 21]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 22]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 23]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 24]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 25]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 26]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 27]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 28]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 29]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 30]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 31]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T; 32]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for [T]

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for VecDeque<T>

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

§

impl<T> Shuffleable for Vec<T>

§

fn shuffle_len(&self) -> usize

§

fn shuffle_swap(&mut self, a: usize, b: usize)

Implementors§