pub trait OperatorClass<T> {
type Instance: Operator<T>;
// Required method
fn instantiate(&self, rhs: &str) -> Result<Self::Instance, FilterError>;
}
Available on crate feature
filter
only.Expand description
Something that can make an operator instance from a right-hand side.
An OperatorClass
can make a particular type of Operator
,
performing any needed parsing on the right-hand side of the filter
expression. The main part of parsing a query is in identifying the
OperatorClass
that can handle the requested left hand side; once
that has been done, that OperatorClass
will take over via
instantiate
and construct the
particular Operator
instance to use for that query.
Required Associated Types§
Required Methods§
Sourcefn instantiate(&self, rhs: &str) -> Result<Self::Instance, FilterError>
fn instantiate(&self, rhs: &str) -> Result<Self::Instance, FilterError>
Create a new Operator
, parsing the supplied argument string
to initialise whatever representation this operator uses to
match against objects. Since this is a parsing operation, it
can fail.