Skip to main content

range_subset

Function range_subset 

Source
pub fn range_subset<T>(
    range: Range<T>,
    size: impl Into<SizeRange>,
) -> RangeSubset<T>
where T: Copy + Ord + Debug, Range<T>: ExactSizeIterator<Item = T>,
Expand description

Sample subsets whose size are within size from the given range.

This is roughly analogous to rand::sample, except that it samples without replacement.

ยงPanics

Panics if the maximum size implied by size is larger than the size of values.

Panics if size is a zero-length range.