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

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

.

A value like `0..=std::usize::MAX`

will still be accepted but will silently
truncate the maximum to `std::usize::MAX - 1`

.

The `Default`

is `0..100`

.

## Methods

`impl SizeRange`

[src]

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

[src]

Creates a `SizeBounds`

from a `RangeInclusive<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 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<RangeInclusive<usize>>, 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() -> Self::Strategy`

[src]

Generates a [`Strategy`

] for producing arbitrary values of type the implementing type (`Self`

). Read more

`impl Debug for SizeRange`

[src]

`impl PartialEq<SizeRange> for SizeRange`

[src]

`impl Eq for SizeRange`

[src]

`impl Add<usize> for SizeRange`

[src]

Adds `usize`

to both start and end of the bounds.

Panics if adding to either end overflows `usize`

.

`type Output = SizeRange`

The resulting type after applying the `+`

operator.

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

[src]

`impl Hash for SizeRange`

[src]

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

[src]

`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

`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]`

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<RangeInclusive<usize>> for SizeRange`

[src]

Given `low ..= high`

, then a size range `[low, high]`

is the result.

`fn from(r: RangeInclusive<usize>) -> Self`

[src]

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

[src]

Given `..=high`

, then a size range `[0, high]`

is the result.

`fn from(high: RangeToInclusive<usize>) -> Self`

[src]

`impl Clone for SizeRange`

[src]

`fn clone(&self) -> SizeRange`

[src]

`fn clone_from(&mut self, source: &Self)`

1.0.0[src]

Performs copy-assignment from `source`

. Read more

`impl Default for SizeRange`

[src]

## Auto Trait Implementations

## Blanket Implementations

`impl<T, U> TryFrom for T where`

U: Into<T>,

[src]

U: Into<T>,

`type Error = Infallible`

The type returned in the event of a conversion error.

`fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>`

[src]

`impl<T> From for T`

[src]

`impl<T, U> TryInto for T where`

U: TryFrom<T>,

[src]

U: TryFrom<T>,

`type Error = <U as TryFrom<T>>::Error`

The type returned in the event of a conversion error.

`fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`

[src]

`impl<T, U> Into for T where`

U: From<T>,

[src]

U: From<T>,

`impl<T> Borrow for T where`

T: ?Sized,

[src]

T: ?Sized,

`impl<T> BorrowMut for T where`

T: ?Sized,

[src]

T: ?Sized,

`fn borrow_mut(&mut self) -> &mut T`

[src]

`impl<T> Any for T where`

T: 'static + ?Sized,

[src]

T: 'static + ?Sized,

`impl<T> ToOwned for T where`

T: Clone,

[src]

T: Clone,