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
impl PassLog
pub fn count(&mut self, what: &str, n: u64)
Sourcepub fn detail(&mut self, label: &str, value: Value)
pub fn detail(&mut self, label: &str, value: Value)
Append a display-only explanation (see PassLog::details), without replacing an earlier explanation.
Sourcepub fn record_removed(&mut self, name: &str)
pub fn record_removed(&mut self, name: &str)
Record that the pass removed component name from some entity (see PassLog::removed).
Sourcepub fn approximate(&mut self, what: &str, n: u64)
pub fn approximate(&mut self, what: &str, n: u64)
Record n items lowered with an approximation ("layer blend baked at 1024 px").
Sourcepub fn approximate_on(&mut self, e: Entity, what: &str, n: u64)
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.
Sourcepub fn omit(&mut self, what: &str, n: u64)
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).
Sourcepub fn dropped(&mut self, measure: Measure, why: &str, n: u64)
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).
Sourcepub fn declared(&self, measure: Measure) -> u64
pub fn declared(&self, measure: Measure) -> u64
The drops it recorded in measure, over every reason.
Sourcepub fn place(&mut self, e: Entity)
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.
Sourcepub fn place_from(&mut self, e: Entity, source: Entity)
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.
Sourcepub fn absorb(&mut self, other: PassLog)
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§
impl Eq for PassLog
impl StructuralPartialEq for PassLog
Auto Trait Implementations§
impl Forget for PassLog
impl Freeze for PassLog
impl RefUnwindSafe for PassLog
impl Send for PassLog
impl Sync for PassLog
impl Unpin for PassLog
impl UnsafeUnpin for PassLog
impl UnwindSafe for PassLog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.