Trait Filter

Source
pub trait Filter<R> {
    // Required method
    fn filter_one(&self, data: &R) -> bool;

    // Provided methods
    fn filter_vec(&self, data: &mut Vec<R>) { ... }
    fn filter_ref_vec(&self, data: &mut Vec<&R>) { ... }
}
Available on crate feature filter only.
Expand description

Test whether an objects to see whether it is included in a given result set.

Each stanza of a query-string results in one Filter being constructed. A unique codepath is generated for every combination of field and operator, which ends up resulting in an efficient Filter for each one.

Required Methods§

Source

fn filter_one(&self, data: &R) -> bool

Produce a true/false response indicating an in/out result for the object.

Provided Methods§

Source

fn filter_vec(&self, data: &mut Vec<R>)

Helper method to filter an entire vector by this filter. Note that there is no virtual function call overhead here.

Source

fn filter_ref_vec(&self, data: &mut Vec<&R>)

Helper method to filter an entire vector by this filter. Note that there is no virtual function call overhead here.

Implementors§