Skip to main content

RandExt

Trait RandExt 

Source
pub trait RandExt: Rand {
    // Provided methods
    fn generate_bytes(&mut self, len: usize) -> Vec<u8>  { ... }
    fn fill_bytes(&mut self, dest: &mut [u8]) { ... }
}
Expand description

Trait RandExt

Provided Methods§

Source

fn generate_bytes(&mut self, len: usize) -> Vec<u8>

Generate random bytes

Source

fn fill_bytes(&mut self, dest: &mut [u8])

Fill bytes

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: Rand + ?Sized> RandExt for T

Implement RandExt for all Rand