Struct SizeRange
pub struct SizeRange(/* private field */);
The minimum and maximum range/bounds on the size of a collection.
The interval must form a subset of [0, usize::MAX).
A value like 0..=usize::MAX will still be accepted but will silently
truncate the maximum to usize::MAX - 1.
The Default is 0..PROPTEST_MAX_DEFAULT_SIZE_RANGE. The max can be set with
the PROPTEST_MAX_DEFAULT_SIZE_RANGE env var, which defaults to 100.
Implementations
impl SizeRange
fn new(range: RangeInclusive<usize>) -> SelfCreates a
SizeBoundsfrom aRangeInclusive<usize>.fn with<X>(self, and: X) -> (Self, X)Merges self together with some other argument producing a product type expected by some implementations of
A: ArbitraryinA::Parameters. This can be more ergonomic to work with and may help type inference.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 implementations of
A: ArbitraryinA::Parameters. This can be more ergonomic to work with and may help type inference.fn start(&self) -> usizeThe lower bound of the range (inclusive).
fn start_end_incl(&self) -> (usize, usize)Extract the ends
[low, high]of aSizeRange.fn end_incl(&self) -> usizeThe upper bound of the range (inclusive).
fn end_excl(&self) -> usizeThe upper bound of the range (exclusive).
Trait Implementations
impl Add<usize> for SizeRange
type Output = SizeRange;fn add(self, rhs: usize) -> Self::Output
impl Arbitrary for SizeRange
type Parameters = ();type Strategy = MapInto<<RangeInclusive<usize> as Arbitrary>::Strategy, SizeRange>;fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy
impl Clone for SizeRange
fn clone(&self) -> Self
impl Debug for SizeRange
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for SizeRange
fn default() -> SelfConstructs a
SizeRangeequivalent tosize_range(0..PROPTEST_MAX_DEFAULT_SIZE_RANGE). The max can be set with thePROPTEST_MAX_DEFAULT_SIZE_RANGEenv var, which defaults to100.
impl Eq for SizeRange
impl From<(usize, usize)> for SizeRange
fn from((low, high): (usize, usize)) -> Self
impl From<Range<usize>> for SizeRange
fn from(r: Range<usize>) -> Self
impl From<RangeInclusive<usize>> for SizeRange
fn from(r: RangeInclusive<usize>) -> Self
impl From<RangeTo<usize>> for SizeRange
fn from(high: RangeTo<usize>) -> Self
impl From<RangeToInclusive<usize>> for SizeRange
fn from(high: RangeToInclusive<usize>) -> Self
impl From<usize> for SizeRange
fn from(exact: usize) -> Self
impl Hash for SizeRange
fn hash<__H: Hasher>(&self, state: &mut __H)
impl PartialEq for SizeRange
fn eq(&self, other: &Self) -> bool