Struct datafrog::ValueFilter[][src]

pub struct ValueFilter<Tuple, Val, Func: Fn(&Tuple, &Val) -> bool> { /* fields omitted */ }

A treefrog leaper based on a predicate of prefix and value. Use like ValueFilter::from(|tuple, value| ...). The closure should return true if value ought to be retained. The value will be a value proposed elsewhere by an extend_with leaper.

This leaper cannot be used in isolation, it must be combined with other leapers.

Implementations

impl<'leap, Tuple, Val, Func> ValueFilter<Tuple, Val, Func> where
    Func: Fn(&Tuple, &Val) -> bool
[src]

pub fn from(predicate: Func) -> Self[src]

Creates a new filter based on the prefix

Trait Implementations

impl<'leap, Tuple, Val, Func> Leaper<'leap, Tuple, Val> for ValueFilter<Tuple, Val, Func> where
    Func: Fn(&Tuple, &Val) -> bool
[src]

fn count(&mut self, _prefix: &Tuple) -> usize[src]

Estimates the number of proposed values.

fn propose(&mut self, _prefix: &Tuple, _values: &mut Vec<&'leap Val>)[src]

Populates values with proposed values.

fn intersect(&mut self, prefix: &Tuple, values: &mut Vec<&'leap Val>)[src]

Restricts values to proposed values.

Auto Trait Implementations

impl<Tuple, Val, Func> RefUnwindSafe for ValueFilter<Tuple, Val, Func> where
    Func: RefUnwindSafe,
    Tuple: RefUnwindSafe,
    Val: RefUnwindSafe

impl<Tuple, Val, Func> Send for ValueFilter<Tuple, Val, Func> where
    Func: Send,
    Tuple: Send,
    Val: Send

impl<Tuple, Val, Func> Sync for ValueFilter<Tuple, Val, Func> where
    Func: Sync,
    Tuple: Sync,
    Val: Sync

impl<Tuple, Val, Func> Unpin for ValueFilter<Tuple, Val, Func> where
    Func: Unpin,
    Tuple: Unpin,
    Val: Unpin

impl<Tuple, Val, Func> UnwindSafe for ValueFilter<Tuple, Val, Func> where
    Func: UnwindSafe,
    Tuple: UnwindSafe,
    Val: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.