Trait RuleOverload

Source
pub trait RuleOverload {
    // Required methods
    fn matches(&self, lhs: &AnyExpr, rhs: &AnyExpr) -> bool;
    fn unroll(
        &self,
        lhs: AnyExpr,
        rhs: AnyExpr,
        context: &mut CompileContext,
        props: Properties,
        inverted: bool,
        weight: ProcNum,
    ) -> Box<dyn Node>;
}
Expand description

Trait for rule overloads

Required Methods§

Source

fn matches(&self, lhs: &AnyExpr, rhs: &AnyExpr) -> bool

Check if this overload can be called with the given expressions.

Source

fn unroll( &self, lhs: AnyExpr, rhs: AnyExpr, context: &mut CompileContext, props: Properties, inverted: bool, weight: ProcNum, ) -> Box<dyn Node>

Unroll this rule.

Implementors§

Source§

impl<L: GeoType, R: GeoType, N: Node + 'static, F: Fn(L, R, &mut CompileContext, Properties, bool, ProcNum) -> N> RuleOverload for FunctionRuleOverload<L, R, F>