Skip to main content

from_fn_boxed

Function from_fn_boxed 

Source
pub fn from_fn_boxed<E, F>(f: F) -> BoxShrink<E>
where E: Clone + 'static, F: Fn(E) -> BoxIter<E> + Clone + 'static,
Expand description

Create a new shrinker where each request for candidates-iterator calls the provided closure F: Fn(E) -> BoxIter<E> + Clone + 'static.

This function does the same thing as from_fn, but with the exception that the returned iterator must be boxed, as in being a trait object. This can be convenient when the closure want to return one of several different iterator implementations, hence iterator type being unclear.

For more details see from_fn.