Trait django_query::filtering::FilterClass
source · [−]pub trait FilterClass<R> {
fn instantiate(&self, rhs: &str) -> Result<Box<dyn Filter<R>>, FilterError>;
}
Expand description
An object that can make a Filter.
To be useful, we need to be able to store objects that can make
different filters for the same target type. That means we need to
return a Box<dyn Filter<R>>
because we can’t make the actual
type we return observable (if we did, we could no longer store
different implementors of this trait together).
Required methods
fn instantiate(&self, rhs: &str) -> Result<Box<dyn Filter<R>>, FilterError>
fn instantiate(&self, rhs: &str) -> Result<Box<dyn Filter<R>>, FilterError>
Create a new Filter
, parsing the rhs
, which are arguments to
whatever Operator
this Filter
encompassses.