pub struct SummaryRegistry { /* private fields */ }Expand description
The summaries and decisions a conversion in parts carries, by resource name.
Implementations§
Source§impl SummaryRegistry
impl SummaryRegistry
pub fn new() -> Self
Sourcepub fn summary<S: Summary>(&mut self)
pub fn summary<S: Summary>(&mut self)
Register a summary: merged over every part, then handed to every part.
Sourcepub fn decision<D: Resource>(&mut self)
pub fn decision<D: Resource>(&mut self)
Register a decision: made once from the merged summaries, then handed to every part.
Sourcepub fn take_summaries(&self, part: &World) -> World
pub fn take_summaries(&self, part: &World) -> World
A world holding only part’s summaries (a copy of each), to keep and merge.
Sourcepub fn merge_order_free(&self, parts: &[World]) -> Result<World, String>
pub fn merge_order_free(&self, parts: &[World]) -> Result<World, String>
The parts’ summaries (each world as SummaryRegistry::take_summaries made it) merged in the order given, and
in the reverse order: an error naming a summary whose two merges differ (its merge depends on the order the
parts arrive in) or that cannot be merged. A consistency check, not a proof of order-freedom (see the module).
Sourcepub fn merge(&self, parts: &[World]) -> Result<World, String>
pub fn merge(&self, parts: &[World]) -> Result<World, String>
The parts’ summaries merged once, in the order given: SummaryRegistry::merge_order_free without its check
of the reverse order, for a conversion that doesn’t run its self-checks (PassManager::pass_checks).
Sourcepub fn hand_on(&self, from: &World, to: &mut World)
pub fn hand_on(&self, from: &World, to: &mut World)
Copy from’s summaries and decisions into to (a part about to run its passes). They stay in the part: the
writer’s target judges them as any other resource.
Sourcepub fn take_summaries_made(&self, w: &World, handed: &World) -> World
pub fn take_summaries_made(&self, w: &World, handed: &World) -> World
A world holding the summaries w made itself: those it holds that handed (what it was handed, as
SummaryRegistry::hand_on gave them) does not, so merging them counts nothing twice.
Sourcepub fn carry_decisions(&self, from: &World, to: &mut World)
pub fn carry_decisions(&self, from: &World, to: &mut World)
Copy from’s decisions (not its summaries) into to.