Struct secp256kfun::nonce::GlobalRng [−][src]
pub struct GlobalRng<R> { /* fields omitted */ }
Expand description
A zero sized type that wraps an RNG that implementes
Default
e.g. ThreadRng
. GlobalRng
implements
NonceRng
and care has been taken to ensure it is Sync
.
Examples
use rand::rngs::ThreadRng; use secp256kfun::nonce::{GlobalRng, NonceRng}; let nonce_rng = GlobalRng::<ThreadRng>::default(); let mut bytes = [0u8; 32]; nonce_rng.fill_bytes(&mut bytes); assert_ne!(bytes, [0u8; 32]); fn is_sync<S: Sync>(x: S) -> bool { true } assert!(is_sync(nonce_rng));
Trait Implementations
Auto Trait Implementations
impl<R> RefUnwindSafe for GlobalRng<R>
impl<R> UnwindSafe for GlobalRng<R>
Blanket Implementations
Mutably borrows from an owned value. Read more
Returns a new instance of the invocant that will be marked with M
. Read more
type Output = T
type Output = T
Should always be Self