[][src]Struct buf_rand::BufRand

pub struct BufRand { /* fields omitted */ }

used to generate random booleans using a bit buffer

Implementations

impl BufRand[src]

pub fn new(rand: Box<dyn RngCore>) -> Self[src]

create a new BufRand which generates random booleans using the supplied rng

pub fn next_bool(&mut self) -> bool[src]

returns a random boolean from the buffer of this BufRand

pub fn rand_char_case(&mut self, c: &char) -> Option<char>[src]

randomizes the capitalization of a char returns None in case the changed character is empty

pub fn rand_string_case(&mut self, s: &str) -> String[src]

randomizes the capitalization of every character in the string

Methods from Deref<Target = Box<dyn RngCore>>

Trait Implementations

impl Deref for BufRand[src]

type Target = Box<dyn RngCore>

The resulting type after dereferencing.

fn deref(&self) -> &Self::Target[src]

allows borrowing the randomizer this BufRand uses

impl DerefMut for BufRand[src]

Auto Trait Implementations

impl !RefUnwindSafe for BufRand

impl !Send for BufRand

impl !Sync for BufRand

impl Unpin for BufRand

impl !UnwindSafe for BufRand

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<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>,