Struct datafrog::PrefixFilter[][src]

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

A treefrog leaper that tests each of the tuples from the main input (the “prefix”). Use like PrefixFilter::from(|tuple| ...); if the closure returns true, then the tuple is retained, else it will be ignored. This leaper can be used in isolation in which case it just acts like a filter on the input (the “proposed value” will be () type).

Implementations

impl<'leap, Tuple, Func> PrefixFilter<Tuple, Func> where
    Func: Fn(&Tuple) -> 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 PrefixFilter<Tuple, Func> where
    Func: Fn(&Tuple) -> 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.

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

Auto Trait Implementations

impl<Tuple, Func> RefUnwindSafe for PrefixFilter<Tuple, Func> where
    Func: RefUnwindSafe,
    Tuple: RefUnwindSafe

impl<Tuple, Func> Send for PrefixFilter<Tuple, Func> where
    Func: Send,
    Tuple: Send

impl<Tuple, Func> Sync for PrefixFilter<Tuple, Func> where
    Func: Sync,
    Tuple: Sync

impl<Tuple, Func> Unpin for PrefixFilter<Tuple, Func> where
    Func: Unpin,
    Tuple: Unpin

impl<Tuple, Func> UnwindSafe for PrefixFilter<Tuple, Func> where
    Func: UnwindSafe,
    Tuple: 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.