Trait django_query::filtering::Filter
source · [−]pub trait Filter<R> {
fn filter_one(&self, data: &R) -> bool;
fn filter_vec(&self, data: &mut Vec<R>) { ... }
fn filter_ref_vec(&self, data: &mut Vec<&R>) { ... }
}
Expand description
An object representing a test for objects to see whether they are included in a given result set.
Each stanza of a query results in one Filter
being
constructed. There is no dynamic dispatch below this point in
general, a unique codepath is generated for every combination of
field and operator, which ends up resulting in a filter for each
one of these.
Required methods
fn filter_one(&self, data: &R) -> bool
fn filter_one(&self, data: &R) -> bool
Produce a true/false response indicating an in/out result for the object.
Provided methods
fn filter_vec(&self, data: &mut Vec<R>)
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.
fn filter_ref_vec(&self, data: &mut Vec<&R>)
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.