# Struct proptest::collection::SizeRange
[−]
[src]

pub struct SizeRange(_);

The minimum and maximum range/bounds on the size of a collection.
The interval must form a subset of `[0, std::usize::MAX)`

.

The `Default`

is `0..100`

.

## Methods

`impl SizeRange`

[src]

`pub fn new(range: Range<usize>) -> Self`

[src]

Creates a `SizeBounds`

from a `Range<usize>`

.

`pub fn with<X>(self, and: X) -> (Self, X)`

[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.

`pub fn lift<X: Default>(self) -> (Self, X)`

[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 SizeRange`

[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 = MapInto<StrategyFor<Range<usize>>, 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 Default for SizeRange`

[src]

`impl From<(usize, usize)> for SizeRange`

[src]

Given `(low: usize, high: usize)`

,
then a size range of `[low..high)`

is the result.

`impl From<usize> for SizeRange`

[src]

Given `exact`

, then a size range of `[exact..exact + 1)`

is the result.

`impl From<RangeTo<usize>> for SizeRange`

[src]

Given `..high`

, then a size range `[0..high)`

is the result.

`impl From<Range<usize>> for SizeRange`

[src]

Given `low..high`

, then a size range `[low..high)`

is the result.

`impl From<SizeRange> for Range<usize>`

[src]

`impl Add<usize> for SizeRange`

[src]

Adds `usize`

to both start and end of the bounds.

`type Output = SizeRange`

The resulting type after applying the `+`

operator.

`fn add(self, rhs: usize) -> Self::Output`

[src]

Performs the `+`

operation.

`impl Clone for SizeRange`

[src]

`fn clone(&self) -> SizeRange`

[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 PartialEq for SizeRange`

[src]

`fn eq(&self, __arg_0: &SizeRange) -> bool`

[src]

This method tests for `self`

and `other`

values to be equal, and is used by `==`

. Read more

`fn ne(&self, __arg_0: &SizeRange) -> bool`

[src]

This method tests for `!=`

.

`impl Eq for SizeRange`

[src]

`impl Hash for SizeRange`

[src]

`fn hash<__H: Hasher>(&self, __arg_0: &mut __H)`

[src]

Feeds this value into the given [`Hasher`

]. Read more

`fn hash_slice<H>(data: &[Self], state: &mut H) where`

H: Hasher,

1.3.0[src]

H: Hasher,

Feeds a slice of this type into the given [`Hasher`

]. Read more