pub trait Entropy {
// Required method
fn fill(&mut self, buf: &mut [u8]) -> Result<(), EntropyError>;
}Expand description
A source of cryptographically secure random bytes.
Blanket-implemented for closures so hosts pass a function, not a global:
natively |b| getrandom::getrandom(b).map_err(...), in Workers the JS
crypto equivalent, in tests a counter. Upholds the sans-I/O law
(design doc 03 §1).
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".