Function proptest::sample::subsequence [] [src]

pub fn subsequence<T, A, S>(values: A, size: S) -> Subsequence<T> where
    A: 'static + Into<Cow<'static, [T]>>,
    T: Clone + 'static,
    S: Into<SizeRange>, 

Sample subsequences whose size are within size from the given collection values.

A subsequence is a subset of the elements in a collection in the order they occur in that collection. The elements are not chosen to be contiguous.

This is roughly analogous to rand::sample, except that it guarantees that the order is preserved.

values may be a static slice or a Vec.


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

Panics if size is a zero-length range.