Trait OperatorClass

Source
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§

Source

type Instance: Operator<T>

The type of Operator this object can make.

Required Methods§

Source

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.

Implementors§

Source§

impl<T> OperatorClass<T> for Contains
where T: Display + FromStr, <T as FromStr>::Err: Error + Send + Sync + 'static,

Source§

impl<T> OperatorClass<T> for EndsWith
where T: Display + FromStr, <T as FromStr>::Err: Error + Send + Sync + 'static,

Source§

impl<T> OperatorClass<T> for Exact
where T: Eq + FromStr, <T as FromStr>::Err: Error + Send + Sync + 'static,

Source§

impl<T> OperatorClass<T> for Greater
where T: Ord + FromStr, <T as FromStr>::Err: Error + Send + Sync + 'static,

Source§

impl<T> OperatorClass<T> for GreaterEq
where T: Ord + FromStr, <T as FromStr>::Err: Error + Send + Sync + 'static,

Source§

impl<T> OperatorClass<T> for IContains
where T: Display + FromStr, <T as FromStr>::Err: Error + Send + Sync + 'static,

Source§

impl<T> OperatorClass<T> for IExact
where T: Display + FromStr, <T as FromStr>::Err: Error + Send + Sync + 'static,

Source§

impl<T> OperatorClass<T> for In
where T: Eq + FromStr, <T as FromStr>::Err: Error + Send + Sync + 'static,

Source§

impl<T> OperatorClass<T> for IsNull

Source§

impl<T> OperatorClass<T> for Less
where T: Ord + FromStr, <T as FromStr>::Err: Error + Send + Sync + 'static,

Source§

impl<T> OperatorClass<T> for LessEq
where T: Ord + FromStr, <T as FromStr>::Err: Error + Send + Sync + 'static,

Source§

impl<T> OperatorClass<T> for StartsWith
where T: Display + FromStr, <T as FromStr>::Err: Error + Send + Sync + 'static,