Module block
The Generator trait and BlockRng
Trait Generator may be implemented by block-generators; that is PRNGs
whose output is a block of words, such as [u32; 16].
The struct BlockRng wraps such a Generator together with an output
buffer and implements several methods (e.g. BlockRng::next_word) to
assist in the implementation of TryRng. Note that (unlike in earlier
versions of rand_core) BlockRng itself does not implement TryRng
since in practice we found it was always beneficial to use a wrapper type
over BlockRng.
Example
use Infallible;
use ;
use ;
// Our RNG is a wrapper over BlockRng
;
// And if applicable: impl TryCryptoRng for MyRng {}
let mut rng = seed_from_u64;
println!;
# assert_eq!;
Structs
Traits
- Generator A random (block) generator