Struct proptest::option::Probability [−][src]
pub struct Probability(_);
A probability in the range [0.0, 1.0]
with a default of 0.5
.
Methods
impl Probability
[src]
impl Probability
pub fn new(prob: f64) -> Self
[src]
pub fn new(prob: f64) -> Self
pub fn with<X>(self, and: X) -> (Self, X)
[src]
pub fn with<X>(self, and: X) -> (Self, X)
Merges self together with some other argument producing a product
type expected by some impelementations of A: Arbitrary
in
A::Parameters
. This can be more ergonomic to work with and may
help type inference.
pub fn lift<X: Default>(self) -> (Self, X)
[src]
pub 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
impelementations of A: Arbitrary
in A::Parameters
.
This can be more ergonomic to work with and may help type inference.
Trait Implementations
impl Arbitrary for Probability
[src]
impl Arbitrary for Probability
type Parameters = ()
The type of parameters that [arbitrary_with
] accepts for configuration of the generated [Strategy
]. Parameters must implement [Default
]. Read more
type Strategy = MapInto<RangeInclusive<f64>, Self>
The type of [Strategy
] used to generate values of type Self
. Read more
fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy
[src]
fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy
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]
fn arbitrary() -> Self::Strategy
Generates a [Strategy
] for producing arbitrary values of type the implementing type (Self
). Read more
impl Default for Probability
[src]
impl Default for Probability
impl From<f64> for Probability
[src]
impl From<f64> for Probability
impl From<Probability> for f64
[src]
impl From<Probability> for f64
fn from(p: Probability) -> Self
[src]
fn from(p: Probability) -> Self
Performs the conversion.
impl Clone for Probability
[src]
impl Clone for Probability
fn clone(&self) -> Probability
[src]
fn clone(&self) -> Probability
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for Probability
[src]
impl Copy for Probability
impl PartialEq for Probability
[src]
impl PartialEq for Probability
fn eq(&self, other: &Probability) -> bool
[src]
fn eq(&self, other: &Probability) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Probability) -> bool
[src]
fn ne(&self, other: &Probability) -> bool
This method tests for !=
.
impl Debug for Probability
[src]
impl Debug for Probability
Auto Trait Implementations
impl Send for Probability
impl Send for Probability
impl Sync for Probability
impl Sync for Probability