pub fn sample_single_excluding_l_reservoir<I, R, T, E>(
rng: &mut R,
iterable: I,
excluded: E,
) -> Option<T>Expand description
Sample one element uniformly from an iterator, excluding any element equal
to excluded. Returns None if the iterator is empty or every element
equals excluded.
This is the iterator counterpart to sample_single_excluding. It runs
in O(n) time and is correct even when the iterator does not report an
exact length. Prefer sample_single_excluding for slices, which can
dispatch to a faster rejection-sampling strategy backed by random access.