pub trait PRStream:
Sized
+ Clone
+ ReprC {
// Required method
unsafe fn fill_raw(&mut self, dst_ptr: *mut u8, dst_len: usize);
// Provided methods
fn fill_block(&mut self, block: &mut [u8]) { ... }
fn next_block<const N: usize>(&mut self) -> [u8; N] { ... }
}Expand description
Represents a pseudo random stream. These are easily convertible
into PRNGs through the StreamPRNG wrapper.
Required Methods§
Provided Methods§
Sourcefn fill_block(&mut self, block: &mut [u8])
fn fill_block(&mut self, block: &mut [u8])
Fills the given block with randomness.
Sourcefn next_block<const N: usize>(&mut self) -> [u8; N]
fn next_block<const N: usize>(&mut self) -> [u8; N]
Generates the next block of given length.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.