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

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

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 implementations 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 implementations of A: Arbitrary in A::Parameters. This can be more ergonomic to work with and may help type inference.

Trait Implementations

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.

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

impl Clone for SizeRange[src]

impl Debug for SizeRange[src]

impl Default for SizeRange[src]

fn default() -> Self[src]

Constructs a SizeRange equivalent to size_range(0..100).

impl Eq 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<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.

impl From<RangeTo<usize>> for SizeRange[src]

Given ..high, then a size range [0, high) is the result.

impl From<RangeToInclusive<usize>> for SizeRange[src]

Given ..=high, then a size range [0, high] is the result.

impl From<usize> for SizeRange[src]

Given exact, then a size range of [exact, exact] is the result.

impl Hash for SizeRange[src]

impl PartialEq<SizeRange> for SizeRange[src]

impl StructuralEq for SizeRange[src]

impl StructuralPartialEq for SizeRange[src]

Auto Trait Implementations

impl Send for SizeRange[src]

impl Sync for SizeRange[src]

impl Unpin for SizeRange[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,