pub struct Probability(_);
A probability in the range [0.0, 1.0]
with a default of 0.5
.
Creates a Probability
from a f64
.
Panics if the probability is outside interval [0.0, 1.0]
.
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.
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.
The type of parameters that [arbitrary_with
] accepts for configuration of the generated [Strategy
]. Parameters must implement [Default
]. Read more
The type of [Strategy
] used to generate values of type Self
. Read more
Generates a [Strategy
] for producing arbitrary values of type the implementing type (Self
). The strategy is passed the arguments given in args. Read more
Generates a [Strategy
] for producing arbitrary values of type the implementing type (Self
). Read more
Formats the value using the given formatter. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Creates a Probability
from a f64
.
Panics if the probability is outside interval [0.0, 1.0]
.
Performs copy-assignment from source
. Read more
The default probability is 0.5, or 50% chance.
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more