Struct Probability
pub struct Probability(/* private field */);
A probability in the range [0.0, 1.0] with a default of 0.5.
Implementations
impl Probability
fn new(prob: f64) -> SelfCreates a
Probabilityfrom af64.Panics
Panics if the probability is outside interval
[0.0, 1.0].fn with<X>(self, and: X) -> (Self, X)Merges self together with some other argument producing a product type expected by some implementations of
A: ArbitraryinA::Parameters. This can be more ergonomic to work with and may help type inference.fn lift<X: Default>(self) -> (Self, X)Merges self together with some other argument generated with a default value producing a product type expected by some implementations of
A: ArbitraryinA::Parameters. This can be more ergonomic to work with and may help type inference.
Trait Implementations
impl Arbitrary for Probability
type Parameters = ();type Strategy = MapInto<RangeInclusive<f64>, Probability>;fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy
impl Clone for Probability
fn clone(&self) -> Self
impl Copy for Probability
impl Debug for Probability
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for Probability
fn default() -> SelfThe default probability is 0.5, or 50% chance.
impl From<f64> for Probability
fn from(prob: f64) -> SelfCreates a
Probabilityfrom af64.Panics
Panics if the probability is outside interval
[0.0, 1.0].
impl PartialEq for Probability
fn eq(&self, other: &Self) -> bool