Skip to main content

CryptoRng

Trait CryptoRng 

pub trait CryptoRng: Rng<Error = Infallible> + TryCryptoRng { }
Expand description

The randomness keys are made with, which the caller supplies: the system’s (rand::rngs::SysRng behind rand_core::UnwrapErr, or rand::rng()), or a device’s own. A marker trait for securely unpredictable infallible RNGs

This is a convenient trait alias for [TryCryptoRng]<Error = Infallible>. It is equivalent to the trait sum [Rng] + [TryCryptoRng].

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

§

impl<R> CryptoRng for R
where R: TryCryptoRng<Error = Infallible> + ?Sized,