Skip to main content

Generator

Trait Generator 

Source
pub trait Generator<const N: usize>: Sized {
    // Required methods
    fn new() -> Result<Self, Error>;
    fn expose(&self) -> &[u8; N];
    fn take(self) -> Zeroizing<[u8; N]>;
    fn zeroize_mem(&mut self);

    // Provided method
    fn generate() -> Result<Zeroizing<[u8; N]>, Error> { ... }
}

Required Methods§

Source

fn new() -> Result<Self, Error>

Source

fn expose(&self) -> &[u8; N]

Source

fn take(self) -> Zeroizing<[u8; N]>

Source

fn zeroize_mem(&mut self)

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<const N: usize> Generator<N> for RandomBytes<N>