Struct proptest_arbitrary::Probability
[−]
[src]
pub struct Probability(_);
A probability in the range [0.0, 1.0] with a default of 0.5.
Methods
impl Probability[src]
fn new(prob: f64) -> Self[src]
fn with<X>(self, and: X) -> HCons<Self, HCons<X, HNil>>[src]
Merges self together with some other argument producing a product
type expected by some impelementations of A: Arbitrary<'a> in
A::Parameters. This can be more ergonomic to work with and may
help type inference.
fn lift<X: Default>(self) -> HCons<Self, HCons<X, HNil>>[src]
Merges self together with some other argument generated with a
default value producing a product type expected by some
impelementations of A: Arbitrary<'a> in A::Parameters.
This can be more ergonomic to work with and may help type inference.
Trait Implementations
impl Default for Probability[src]
impl From<f64> for Probability[src]
impl<'a> Arbitrary<'a> for Probability[src]
type ValueTree = <Self::Strategy as Strategy>::Value
The type of [ValueTree] used for Self's [Strategy]. Read more
type Parameters = ()
The type of parameters that [arbitrary_with] accepts for configuration of the generated [Strategy]. Parameters must implement [Default]. Read more
type Strategy = SMap<Range<f64>, FromMapper<ValueFor<Range<f64>>, Self>>
The type of [Strategy] used to generate values of type Self. Read more
fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy[src]
Generates a [Strategy] for producing arbitrary values of type the implementing type (Self). The strategy is passed the arguments given in args. Read more
fn arbitrary() -> Self::Strategy[src]
Generates a [Strategy] for producing arbitrary values of type the implementing type (Self). Read more
impl Generic for Probability[src]
type Repr = f64
The generic representation type
fn into(self) -> Self::Repr[src]
Converts the Probability into an f64.
fn from(r: Self::Repr) -> Self[src]
fn convert_from<A>(a: A) -> Self where
A: Generic<Repr = Self::Repr>, [src]
A: Generic<Repr = Self::Repr>,
From one type to another using a type with a compatible generic representation
impl Clone for Probability[src]
fn clone(&self) -> Probability[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Copy for Probability[src]
impl PartialEq for Probability[src]
fn eq(&self, __arg_0: &Probability) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &Probability) -> bool[src]
This method tests for !=.