Struct wasi_common::random::Deterministic
source · [−]pub struct Deterministic { /* private fields */ }
Expand description
Implement WasiRandom
using a deterministic cycle of bytes.
Implementations
Trait Implementations
sourceimpl RngCore for Deterministic
impl RngCore for Deterministic
Auto Trait Implementations
impl RefUnwindSafe for Deterministic
impl Send for Deterministic
impl Sync for Deterministic
impl Unpin for Deterministic
impl UnwindSafe for Deterministic
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<R> Rng for R where
R: RngCore + ?Sized,
impl<R> Rng for R where
R: RngCore + ?Sized,
sourcefn gen<T>(&mut self) -> T where
Standard: Distribution<T>,
fn gen<T>(&mut self) -> T where
Standard: Distribution<T>,
sourcefn gen_range<T, R>(&mut self, range: R) -> T where
T: SampleUniform,
R: SampleRange<T>,
fn gen_range<T, R>(&mut self, range: R) -> T where
T: SampleUniform,
R: SampleRange<T>,
Generate a random value in the given range. Read more
sourcefn sample<T, D>(&mut self, distr: D) -> T where
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> T where
D: Distribution<T>,
Sample a new value, using the given distribution. Read more
sourcefn sample_iter<T, D>(self, distr: D) -> DistIter<D, Self, T> where
D: Distribution<T>,
fn sample_iter<T, D>(self, distr: D) -> DistIter<D, Self, T> where
D: Distribution<T>,
Create an iterator that generates values using the given distribution. Read more
sourcefn 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 more
sourcefn 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
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more