Skip to main content

PassLog

Struct PassLog 

Source
pub struct PassLog {
    pub counts: BTreeMap<String, u64>,
    pub approximations: BTreeMap<String, u64>,
    pub approximated_on: BTreeMap<String, BTreeSet<Entity>>,
    pub omitted: BTreeMap<String, u64>,
    pub removed: BTreeSet<String>,
    pub placed: BTreeSet<Entity>,
    pub placed_from: BTreeMap<Entity, Entity>,
    pub drops: BTreeMap<(Measure, String), u64>,
    pub details: BTreeMap<String, Vec<Value>>,
}
Expand description

Counts a pass logs while it runs: what it changed, what it approximated and what it left out, and the entities it placed.

Fields§

§counts: BTreeMap<String, u64>§approximations: BTreeMap<String, u64>§approximated_on: BTreeMap<String, BTreeSet<Entity>>

Of PassLog::approximations, the entities each reason was recorded on (PassLog::approximate_on): the material or mesh the approximation concerns, by reason. An approximation recorded with PassLog::approximate names none. The ids are the world’s the pass ran on; the manager refuses one that is not alive after the pass.

§omitted: BTreeMap<String, u64>

What the pass left out because what it makes has no form for it, by reason (collision triangles on a surface of another kind, left out: PHYS_CASTER). A conversion reports each as an unsupported notice.

§removed: BTreeSet<String>

Component names the pass removed from some entity without declaring them in Pass::removes (a component a hook dropped, as World::apply_linear reports): accepted as removals only for a pass that opts in with Pass::removes_by_log.

§placed: BTreeSet<Entity>

Entities the pass made that stand on their own: content nothing need reference (a marker it places). A conversion keeps them with the writer’s roots (crate::convert); any other entity a pass makes is kept only while something kept references it. The manager refuses an entity here that the pass did not make.

§placed_from: BTreeMap<Entity, Entity>

Of PassLog::placed, those made from one source entity, with it (PassLog::place_from).

§drops: BTreeMap<(Measure, String), u64>

What the pass left out on purpose, by measure and reason (placements in an interior left out); a conversion reports each as a selection notice (crate::ledger).

§details: BTreeMap<String, Vec<Value>>

Display-only structured explanations that the typed selections/exclusions, approximations and counts cannot express; prefer those typed entries first. A program may show these values generically, but must never parse their fields or branch on their contents. A value needed for a decision belongs in a typed core field. Repeated entries under one label retain their order when logs join. JSON reporters omit this field when empty.

Implementations§

Source§

impl PassLog

Source

pub fn count(&mut self, what: &str, n: u64)

Source

pub fn detail(&mut self, label: &str, value: Value)

Append a display-only explanation (see PassLog::details), without replacing an earlier explanation.

Source

pub fn record_removed(&mut self, name: &str)

Record that the pass removed component name from some entity (see PassLog::removed).

Source

pub fn approximate(&mut self, what: &str, n: u64)

Record n items lowered with an approximation ("layer blend baked at 1024 px").

Source

pub fn approximate_on(&mut self, e: Entity, what: &str, n: u64)

Record n items lowered with an approximation, on the entity e they concern (a material whose base albedo could not be read): PassLog::approximate and the entity kept with the reason (PassLog::approximated_on). The count stays the number of items, not of entities: one call per item, or n items of one entity.

Source

pub fn omit(&mut self, what: &str, n: u64)

Record n items left out because what the pass makes has no form for them (see PassLog::omitted).

Source

pub fn dropped(&mut self, measure: Measure, why: &str, n: u64)

Record n of measure left out on purpose, and why (see PassLog::drops; an entity despawned whole: crate::ledger::despawn).

Source

pub fn declared(&self, measure: Measure) -> u64

The drops it recorded in measure, over every reason.

Source

pub fn place(&mut self, e: Entity)

Record that the pass made e as content of its own (see PassLog::placed): content of the whole world, as a spawn a selection places. Content made from one source entity is PassLog::place_from.

Source

pub fn place_from(&mut self, e: Entity, source: Entity)

Record that the pass made e as content of its own from source (a marker for a placement): a conversion in parts keeps it only in the part that owns source, so content made from a neighbour loaded as context is written once, by its owner.

Source

pub fn absorb(&mut self, other: PassLog)

Take in the log of work done on the pass’s behalf (a function returning its own PassLog): every count, approximation and omission added to this log’s, its recorded removals and its placed entities (with their sources) and drops, so nothing it reported is lost on the way to the pass’s report.

Trait Implementations§

Source§

impl Clone for PassLog

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PassLog

Source§

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

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

impl Default for PassLog

Source§

fn default() -> Self

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

impl Eq for PassLog

Source§

impl PartialEq for PassLog

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PassLog

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.