pub trait NonceRng {
// Required method
fn fill_bytes(&self, bytes: &mut [u8]);
}Expand description
A helper trait over RNGs that handle internal mutablility.
Used by the Synthetic nonce generator.
RngCore requires self to be mutable which is annoying in our context. This trait requires
the rng be able to create randomness without being mutable. The most strightforward way of doing
this is to use rngs instances like ThreadRng that have a Default implementation are and
seeded from the system. See GlobalRng.
If you want to BYO rng you have to either implement this trait or wrap the RngCore in a
RefCell or Mutex.
Required Methods§
Sourcefn fill_bytes(&self, bytes: &mut [u8])
fn fill_bytes(&self, bytes: &mut [u8])
Fill bytes with random data.