filter

Function filter 

Source
pub fn filter<'a>(
    ops: impl IntoIterator<Item = &'a PlannedOp>,
    see: ScopeSet,
) -> Vec<PlanOp>
Expand description

Keep the operations this connection can see.

Filtering preserves validity for free. Every ordering rule in the plan is a constraint of the form “X before Y”, and dropping elements from a sequence violates none of them. So a valid plan, filtered, is still a valid plan and there is nothing to replan. The closure theorem does the real work: it is what guarantees no reference is left dangling by the elements that were dropped.

Takes anything that iterates borrowed operations, so a freshly planned Vec<PlannedOp> and a Vec<&PlannedOp> replayed out of the journal both go through the same function.