Expand description
Capability-based random number generators
This corresponds to rand
.
Capability-based APIs represent access to external resources as values which can be passed around between different parts of a program.
Two notable features are the OsRng
and CapRng
types, which
wrap up access to the operating system entropy source in capability
values.
This crate uses the existing rand::SeedableRng
trait rather than having
its own version, however while rand::SeedableRng
is mostly just a pure
interface, it provides a from_entropy
function which directly reads
from the operating system entropy source. To preserve the
capability-based interface, avoid using rand::SeedableRng
’s
from_entropy
function on any of the types that implement that trait; use
std_rng_from_entropy
instead.
Modules
Structs
AmbientAuthority
type serve to indicate that the
[ambient_authority
] function has been called, indicating that the user
has explicitly opted into using ambient authority.Traits
RngCore
or BlockRngCore
implementation is supposed to be cryptographically secure.RngCore
providing high-level
generic methods for sampling values and other convenience methods.Functions
AmbientAuthority
value, which allows use of functions that
include an AmbientAuthority
argument.