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]
impl SizeRangepub fn new(range: RangeInclusive<usize>) -> Self[src]
pub fn new(range: RangeInclusive<usize>) -> SelfCreates a SizeBounds from a RangeInclusive<usize>.
pub fn with<X>(self, and: X) -> (Self, X)[src]
pub fn with<X>(self, and: X) -> (Self, X)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]
pub fn lift<X: Default>(self) -> (Self, X)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]
impl Arbitrary for SizeRangetype 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_with(_args: Self::Parameters) -> Self::StrategyGenerates 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]
fn arbitrary() -> Self::StrategyGenerates a [Strategy] for producing arbitrary values of type the implementing type (Self). Read more
impl Default for SizeRange[src]
impl Default for SizeRangeimpl From<(usize, usize)> for SizeRange[src]
impl From<(usize, usize)> for SizeRangeGiven (low: usize, high: usize),
then a size range of [low..high) is the result.
impl From<usize> for SizeRange[src]
impl From<usize> for SizeRangeGiven exact, then a size range of [exact, exact] is the result.
impl From<RangeTo<usize>> for SizeRange[src]
impl From<RangeTo<usize>> for SizeRangeGiven ..high, then a size range [0, high) is the result.
impl From<Range<usize>> for SizeRange[src]
impl From<Range<usize>> for SizeRangeGiven low .. high, then a size range [low, high) is the result.
impl From<RangeInclusive<usize>> for SizeRange[src]
impl From<RangeInclusive<usize>> for SizeRangeGiven low ..= high, then a size range [low, high] is the result.
fn from(r: RangeInclusive<usize>) -> Self[src]
fn from(r: RangeInclusive<usize>) -> SelfPerforms the conversion.
impl From<RangeToInclusive<usize>> for SizeRange[src]
impl From<RangeToInclusive<usize>> for SizeRangeGiven ..=high, then a size range [0, high] is the result.
fn from(high: RangeToInclusive<usize>) -> Self[src]
fn from(high: RangeToInclusive<usize>) -> SelfPerforms the conversion.
impl From<SizeRange> for Range<usize>[src]
impl From<SizeRange> for Range<usize>Given a size range [low, high], then a rangelow..(high + 1) is returned.
This will panic if high == usize::MAX.
impl From<SizeRange> for RangeInclusive<usize>[src]
impl From<SizeRange> for RangeInclusive<usize>Given a size range [low, high], then a range low..=high is returned.
impl Add<usize> for SizeRange[src]
impl Add<usize> for SizeRangeAdds 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]
fn add(self, rhs: usize) -> Self::OutputPerforms the + operation.
impl Clone for SizeRange[src]
impl Clone for SizeRangefn clone(&self) -> SizeRange[src]
fn clone(&self) -> SizeRangeReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl PartialEq for SizeRange[src]
impl PartialEq for SizeRangefn eq(&self, other: &SizeRange) -> bool[src]
fn eq(&self, other: &SizeRange) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &SizeRange) -> bool[src]
fn ne(&self, other: &SizeRange) -> boolThis method tests for !=.
impl Eq for SizeRange[src]
impl Eq for SizeRangeimpl Hash for SizeRange[src]
impl Hash for SizeRangefn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash<__H: Hasher>(&self, state: &mut __H)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]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl Debug for SizeRange[src]
impl Debug for SizeRange