pub struct Backward<T>(pub T);Expand description
Backward compatibility container object
Tuple Fields§
§0: TTrait Implementations§
Source§impl<T: RngCore> RngCore for Backward<T>
Implementation of rand_core_0_5::RngCore for backward compatibility
impl<T: RngCore> RngCore for Backward<T>
Implementation of rand_core_0_5::RngCore for backward compatibility
Source§fn fill_bytes(&mut self, dest: &mut [u8])
fn fill_bytes(&mut self, dest: &mut [u8])
Fill
dest with random data. Read moreimpl<T: RngCore + CryptoRng> CryptoRng for Backward<T>
Backward rand_core_0_5::CryptoRng marker for rand_core_0_6::CryptoRng types
impl<T> StructuralPartialEq for Backward<T>
Auto Trait Implementations§
impl<T> Freeze for Backward<T>where
T: Freeze,
impl<T> RefUnwindSafe for Backward<T>where
T: RefUnwindSafe,
impl<T> Send for Backward<T>where
T: Send,
impl<T> Sync for Backward<T>where
T: Sync,
impl<T> Unpin for Backward<T>where
T: Unpin,
impl<T> UnwindSafe for Backward<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ForwardCompat<T> for Twhere
T: RngCore,
impl<T> ForwardCompat<T> for Twhere
T: RngCore,
Source§fn forward(self) -> Forward<T>
fn forward(self) -> Forward<T>
Call .forward() on an 0.5.x rand_core_0_5::RngCore to receive a 0.6.x rand_core_0_6::RngCore compatible instance
Source§impl<R> Rng for R
impl<R> Rng for R
Source§fn gen<T>(&mut self) -> Twhere
Standard: Distribution<T>,
fn gen<T>(&mut self) -> Twhere
Standard: Distribution<T>,
Source§fn gen_range<T, B1, B2>(&mut self, low: B1, high: B2) -> T
fn gen_range<T, B1, B2>(&mut self, low: B1, high: B2) -> T
Generate a random value in the range [
low, high), i.e. inclusive of
low and exclusive of high. Read moreSource§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Sample a new value, using the given distribution. Read more
Source§fn sample_iter<T, D>(self, distr: D) -> DistIter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> DistIter<D, Self, T>where
D: Distribution<T>,
Self: Sized,
Create an iterator that generates values using the given distribution. Read more
Source§fn fill<T>(&mut self, dest: &mut T)where
T: AsByteSliceMut + ?Sized,
fn fill<T>(&mut self, dest: &mut T)where
T: AsByteSliceMut + ?Sized,
Fill
dest entirely with random bytes (uniform value distribution),
where dest is any type supporting AsByteSliceMut, namely slices
and arrays over primitive integer types (i8, i16, u32, etc.). Read moreSource§fn try_fill<T>(&mut self, dest: &mut T) -> Result<(), Error>where
T: AsByteSliceMut + ?Sized,
fn try_fill<T>(&mut self, dest: &mut T) -> Result<(), Error>where
T: AsByteSliceMut + ?Sized,
Fill
dest entirely with random bytes (uniform value distribution),
where dest is any type supporting AsByteSliceMut, namely slices
and arrays over primitive integer types (i8, i16, u32, etc.). Read moreSource§fn gen_bool(&mut self, p: f64) -> bool
fn gen_bool(&mut self, p: f64) -> bool
Return a bool with a probability
p of being true. Read moreSource§fn gen_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn gen_ratio(&mut self, numerator: u32, denominator: u32) -> bool
Return a bool with a probability of
numerator/denominator of being
true. I.e. gen_ratio(2, 3) has chance of 2 in 3, or about 67%, of
returning true. If numerator == denominator, then the returned value
is guaranteed to be true. If numerator == 0, then the returned
value is guaranteed to be false. Read more