pub trait OptimizationPass: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn run(&self, graph: &mut Graph, ctx: &PassContext) -> Result<()>;
// Provided method
fn postconditions(&self, graph: &Graph) -> Result<()> { ... }
}Expand description
A single graph→graph rewrite (see docs/ORT2.md §18.1).
Passes mutate the Graph in place and must preserve its structural
invariants; postconditions is checked
after each pass in debug builds by run_passes.
Required Methods§
Provided Methods§
Sourcefn postconditions(&self, graph: &Graph) -> Result<()>
fn postconditions(&self, graph: &Graph) -> Result<()>
Invariants that must hold after this pass. The default requires the
graph to pass full structural validation (Graph::validate).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".