#[non_exhaustive]pub struct Affected<'a> {
pub roots: IndexSet<&'a str>,
pub shaders: IndexSet<&'a str>,
pub outputs: bool,
pub everything: bool,
}Expand description
What a Changes batch may have moved.
Candidates, not a minimal set. An entry means “resolve this
again”, not “this definitely differs”: ɴsɪ’s precedence rules can
make an edit invisible – a re-armed surfaceshader at a lower
priority than a nearer one changes nothing – and deciding that
here would mean remembering every previous answer this crate ever
gave, which is the consumer’s own record to keep.
Keyed by handle, not by placement path. One geometry under two parents is several objects to a renderer, and editing one parent moves only one of them; a handle-level answer makes the consumer re-resolve both. Correct, and coarse for a crowd – path-precision is an optimisation to ask for with a measurement.
§Why it borrows
Every handle in here already lives in the Scene or in the
Changes it was computed from, so owning them meant a String
clone per named node on a path an interactive host walks every
frame. Measured, one transform with n children, debug build,
best of ten: 1000 nodes 2.08 ms, 10 000 27.3 ms, 50 000 88.9 ms –
about 2 us a node, four to five allocations of it. Borrowing costs
a lifetime on the type and nothing else.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.roots: IndexSet<&'a str>The roots of what may have moved: these nodes and
everything below them on the objects chain.
Roots rather than an enumeration, because enumerating is
O(scene) for the edit that matters least – moving one
transform near the top of a production scene names every
geometry under it, and a set-dressing scene has millions. The
consumer walks its own objects anyway;
Scene::descendants expands a root when it wants the list.
shaders: IndexSet<&'a str>Shader nodes whose own attributes or network changed.
Kept apart because they map one-to-one onto a renderer’s
material parameters and cost no geometry work: only the root
shader’s identity reaches geometry, and that is a
surfaceshader edge, which lands in nodes.
outputs: boolWhether the camera/screen/layer/driver chain changed, so the outputs need re-reading.
everything: boolWhether something global changed – an attribute on .root or
.global – and the whole scene is a candidate.
When this is set, nodes is not filled: the answer is
everything, and listing it would be a copy of the scene.
Trait Implementations§
impl<'a> Eq for Affected<'a>
impl<'a> StructuralPartialEq for Affected<'a>
Auto Trait Implementations§
impl<'a> Forget for Affected<'a>
impl<'a> Freeze for Affected<'a>
impl<'a> Move for Affected<'a>
impl<'a> RefUnwindSafe for Affected<'a>
impl<'a> Send for Affected<'a>
impl<'a> Sync for Affected<'a>
impl<'a> Unpin for Affected<'a>
impl<'a> UnsafeUnpin for Affected<'a>
impl<'a> UnwindSafe for Affected<'a>
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.