Struct Filter

#[must_use = "strategies do nothing unless used"]
pub struct Filter<S, F> { /* private fields */ }

Static version of strategy::Filter.

Implementations

impl<S, F> Filter<S, F>

fn new(source: S, whence: Reason, filter: F) -> Self

Adapt strategy source to reject values which do not pass filter, using whence as the reported reason/location.

Trait Implementations

impl<S: Clone, F: Clone> Clone for Filter<S, F>

fn clone(&self) -> Self

impl<S: Debug, F> Debug for Filter<S, F>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl<S: Strategy, F: FilterFn<S::Value> + Clone> Strategy for Filter<S, F>

type Tree = Filter<<S as Strategy>::Tree, F>;
type Value = <S as Strategy>::Value;
fn new_tree(&self, runner: &mut TestRunner) -> NewTree<Self>

impl<S: ValueTree, F: FilterFn<S::Value>> ValueTree for Filter<S, F>

type Value = <S as ValueTree>::Value;
fn current(&self) -> S::Value
fn simplify(&mut self) -> bool
fn complicate(&mut self) -> bool

Auto Trait Implementations

impl<S, F> Freeze for Filter<S, F> where S: Freeze, F: Freeze,

impl<S, F> RefUnwindSafe for Filter<S, F> where S: RefUnwindSafe, F: RefUnwindSafe,

impl<S, F> Send for Filter<S, F> where S: Send, F: Send,

impl<S, F> Sync for Filter<S, F> where S: Sync, F: Sync,

impl<S, F> Unpin for Filter<S, F> where S: Unpin, F: Unpin,

impl<S, F> UnsafeUnpin for Filter<S, F> where S: UnsafeUnpin, F: UnsafeUnpin,

impl<S, F> UnwindSafe for Filter<S, F> where S: UnwindSafe, F: UnwindSafe,

Blanket Implementations

impl<T> Any for Filter<S, F> where T: 'static + ?Sized,

impl<T> Borrow<T> for Filter<S, F> where T: ?Sized,

impl<T> BorrowMut<T> for Filter<S, F> where T: ?Sized,

impl<T> CloneToUninit for Filter<S, F> where T: Clone,

impl<T> From<T> for Filter<S, F>

impl<T> ToOwned for Filter<S, F> where T: Clone,

impl<T, U> Into<U> for Filter<S, F> where U: From<T>,

impl<T, U> TryFrom<U> for Filter<S, F> where U: Into<T>,

impl<T, U> TryInto<U> for Filter<S, F> where U: TryFrom<T>,