[−][src]Struct schnorr_fun::nonce::GlobalRng
A zero sized type that wraps an instance of an RNG that implementes
Default
e.g. OsRng
. 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
impl<R> Clone for GlobalRng<R> where
R: Clone,
[src]
R: Clone,
impl<R> Debug for GlobalRng<R> where
R: Debug,
[src]
R: Debug,
impl<R> Default for GlobalRng<R> where
R: Default,
[src]
R: Default,
impl<R> NonceRng for GlobalRng<R> where
R: Default + RngCore + CryptoRng,
[src]
R: Default + RngCore + CryptoRng,
We implement NonceRng only for rngs we can conjure out of thin air with Default
.
fn fill_bytes(&self, bytes: &mut [u8])
[src]
Auto Trait Implementations
impl<R> RefUnwindSafe for GlobalRng<R>
impl<R> Send for GlobalRng<R>
impl<R> Sync for GlobalRng<R>
impl<R> Unpin for GlobalRng<R>
impl<R> UnwindSafe for GlobalRng<R>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Mark for T
[src]
#[must_use]fn mark<M>(self) -> <M as ChangeMark<T>>::Out where
M: ChangeMark<T>,
[src]
M: ChangeMark<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,