[][src]Trait rand_core::block::BlockRngCore

pub trait BlockRngCore {
    type Item;
    type Results: AsRef<[Self::Item]> + AsMut<[Self::Item]> + Default;
    fn generate(&mut self, results: &mut Self::Results);
}
[]

A trait for RNGs which do not generate random numbers individually, but in blocks (typically [u32; N]). This technique is commonly used by cryptographic RNGs to improve performance.

See the [module][crate::block] documentation for details.

Associated Types

type Item[]

Results element type, e.g. u32.

type Results: AsRef<[Self::Item]> + AsMut<[Self::Item]> + Default[]

Results type. This is the 'block' an RNG implementing BlockRngCore generates, which will usually be an array like [u32; 16].

Required methods

fn generate(&mut self, results: &mut Self::Results)[]

Generate a new block of results.

Implementors

impl BlockRngCore for ChaChaCore

impl BlockRngCore for Hc128Core

impl BlockRngCore for IsaacCore

impl BlockRngCore for Isaac64Core

impl BlockRngCore for ChaCha20Core

impl BlockRngCore for ChaCha12Core

impl BlockRngCore for ChaCha8Core

impl BlockRngCore for Hc128Core

impl BlockRngCore for IsaacCore

impl BlockRngCore for Isaac64Core