Skip to main content

SummaryRegistry

Struct SummaryRegistry 

Source
pub struct SummaryRegistry { /* private fields */ }
Expand description

The summaries and decisions a conversion in parts carries, by resource name.

Implementations§

Source§

impl SummaryRegistry

Source

pub fn new() -> Self

Source

pub fn summary<S: Summary>(&mut self)

Register a summary: merged over every part, then handed to every part.

Source

pub fn decision<D: Resource>(&mut self)

Register a decision: made once from the merged summaries, then handed to every part.

Source

pub fn summaries(&self) -> impl Iterator<Item = &'static str> + '_

The summaries’ names.

Source

pub fn decisions(&self) -> impl Iterator<Item = &'static str> + '_

The decisions’ names.

Source

pub fn retained(&self, w: &World) -> usize

The bytes w’s summaries hold, as they state them.

Source

pub fn take_summaries(&self, part: &World) -> World

A world holding only part’s summaries (a copy of each), to keep and merge.

Source

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).

Source

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).

Source

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.

Source

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.

Source

pub fn carry_decisions(&self, from: &World, to: &mut World)

Copy from’s decisions (not its summaries) into to.

Trait Implementations§

Source§

impl Debug for SummaryRegistry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SummaryRegistry

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.