OpenMlsRand

Trait OpenMlsRand 

pub trait OpenMlsRand {
    type Error: Error + Debug;

    // Required methods
    fn random_array<const N: usize>(&self) -> Result<[u8; N], Self::Error>;
    fn random_vec(&self, len: usize) -> Result<Vec<u8>, Self::Error>;
}
Available on 32-bit or 64-bit only.

Required Associated Types§

type Error: Error + Debug

Required Methods§

fn random_array<const N: usize>(&self) -> Result<[u8; N], Self::Error>

Fill an array with random bytes.

fn random_vec(&self, len: usize) -> Result<Vec<u8>, Self::Error>

Fill a vector of length len with bytes.

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.

Implementations on Foreign Types§

§

impl OpenMlsRand for CryptoProvider

§

type Error = RandError

§

fn random_array<const N: usize>( &self, ) -> Result<[u8; N], <CryptoProvider as OpenMlsRand>::Error>

§

fn random_vec( &self, len: usize, ) -> Result<Vec<u8>, <CryptoProvider as OpenMlsRand>::Error>

§

impl OpenMlsRand for RustCrypto

§

type Error = RandError

§

fn random_array<const N: usize>( &self, ) -> Result<[u8; N], <RustCrypto as OpenMlsRand>::Error>

§

fn random_vec( &self, len: usize, ) -> Result<Vec<u8>, <RustCrypto as OpenMlsRand>::Error>

Implementors§