Skip to main content

schedule_rewrites

Function schedule_rewrites 

Source
pub fn schedule_rewrites<S>(
    rewrites: &[PageRewrite<S>],
) -> Result<Box<[RewriteId]>, EngineConstructionError>
where S: MarkingScheme + ?Sized,
Expand description

Compute the topological order of rewrites by their reads / writes axes.

Returns the ordered list of RewriteIds. Rewrites that have no predecessor (neither read nor write a category another rewrite writes) retain their declaration order relative to each other (FR-007: declaration-order independence for cycle-free inputs — but for rewrites with no edge between them, the only stable answer is declaration order).

§Errors

  • EngineConstructionError::UnannotatedCustomAxes if any rewrite with a Custom trigger or action has empty reads or writes. Declarative rewrites (Contains / Empty triggers with Clear / Replace / Promote actions) are permitted to have empty annotations — the scheduler treats them as “no dataflow dependency” rather than as an authoring bug.
  • EngineConstructionError::RewriteCycle if the axis graph contains a cycle. All members participating in the cycle are reported, not just the entry point.