pub trait SingleOpTransform: Transform {
    // Required methods
    fn match_operator(&mut self, op: &OperatorDef);
    fn replace_operator(&mut self, op: *mut OperatorDef);

    // Provided methods
    fn pattern_rule(&mut self, g: &Graph, subgraph: &Vec<i32>, idx: i32) -> bool { ... }
    fn validator_rule(&mut self, g: &Graph, subgraph: &Vec<i32>) -> bool { ... }
    fn replace_rule(&mut self, subgraph: &Vec<i32>, g_ptr: *mut Graph) -> bool { ... }
}
Expand description

| Single Op Transform Base class | | A transform which is applied to a single | node, in place. | | Transforms which derive from SingleOpTransform | need to override: | | ReplaceOperator and MatchOperator. |

Required Methods§

source

fn match_operator(&mut self, op: &OperatorDef)

| Specify what the op needs to be to match | the pattern. |

source

fn replace_operator(&mut self, op: *mut OperatorDef)

| Specify how the operator should be replaced. |

Provided Methods§

source

fn pattern_rule(&mut self, g: &Graph, subgraph: &Vec<i32>, idx: i32) -> bool

source

fn validator_rule(&mut self, g: &Graph, subgraph: &Vec<i32>) -> bool

source

fn replace_rule(&mut self, subgraph: &Vec<i32>, g_ptr: *mut Graph) -> bool

Implementors§