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]

[src]

Creates a Probability from a f64.

Safety

Panics if the probability is outside interval [0.0, 1.0].

[src]

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.

[src]

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]

The type of [ValueTree] used for Self's [Strategy]. Read more

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

[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

[src]

Generates a [Strategy] for producing arbitrary values of type the implementing type (Self). Read more

impl Default for Probability
[src]

[src]

The default probability is 0.5, or 50% chance.

impl From<f64> for Probability
[src]

[src]

Creates a Probability from a f64.

Safety

Panics if the probability is outside interval [0.0, 1.0].

impl From<Probability> for f64
[src]

[src]

Performs the conversion.

impl Clone for Probability
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Probability
[src]

impl PartialEq for Probability
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Debug for Probability
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Probability

impl Sync for Probability