# Struct proptest::collection::SizeRange

source · [−]`pub struct SizeRange(_);`

## Expand description

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`

.

## Implementations

source### impl SizeRange

### impl SizeRange

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

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

Creates a `SizeBounds`

from a `RangeInclusive<usize>`

.

## Trait Implementations

source### impl Add<usize> for SizeRange

### impl Add<usize> for SizeRange

Adds `usize`

to both start and end of the bounds.

Panics if adding to either end overflows `usize`

.

source### impl Arbitrary for SizeRange

### impl Arbitrary for SizeRange

#### type Parameters = ()

#### type Parameters = ()

The type of parameters that `arbitrary_with`

accepts for configuration
of the generated `Strategy`

. Parameters must implement `Default`

. Read more

source#### fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy

#### fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy

source### impl From<(usize, usize)> for SizeRange

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

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

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

is the result.

source### impl From<Range<usize>> for SizeRange

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

Given `low .. high`

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

is the result.

source### impl From<RangeInclusive<usize>> for SizeRange

### impl From<RangeInclusive<usize>> for SizeRange

Given `low ..= high`

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

is the result.

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

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

Converts to this type from the input type.

source### impl From<RangeTo<usize>> for SizeRange

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

Given `..high`

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

is the result.

source### impl From<RangeToInclusive<usize>> for SizeRange

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

Given `..=high`

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

is the result.

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

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

Converts to this type from the input type.

### impl Eq for SizeRange

### impl StructuralEq for SizeRange

### impl StructuralPartialEq for SizeRange

## Auto Trait Implementations

### impl RefUnwindSafe for SizeRange

### impl Send for SizeRange

### impl Sync for SizeRange

### impl Unpin for SizeRange

### impl UnwindSafe for SizeRange

## Blanket Implementations

source### impl<T> BorrowMut<T> for T where

T: ?Sized,

### impl<T> BorrowMut<T> for T where

T: ?Sized,

const: unstable · source#### fn borrow_mut(&mut self) -> &mut T

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

Mutably borrows from an owned value. Read more