#[non_exhaustive]pub struct Changes {
pub edges_added: Vec<Edge>,
pub edges_removed: Vec<Edge>,
pub edges_rearmed: Vec<Edge>,
/* private fields */
}Expand description
What changed since the last Scene::take_changes.
A net record, not a log of calls: re-setting one attribute
forty times is one entry, connecting and reconnecting one edge is
one entry, and a handle created and then deleted in the same
interval appears only in Changes::deleted – the create is
undone by the delete, and a consumer that never saw the node has
nothing to undo. A consumer synchronising a live renderer wants the
set of things to look at again, and coalescing a call log into that
set would be its work rather than ours.
It carries no values. The scene holds the current one –
Node::effective answers it – so an entry names an attribute
rather than copying a vertex buffer per edit.
This is the raw record, and it is deliberately in ɴsɪ’s domain: a
transform and an attributes node have no counterpart in a
renderer’s scene, and one geometry under two parents is several
objects there. Scene::affected turns “this transform moved”
into “these nodes may have moved”, which is the question a backend
actually asks.
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.edges_added: Vec<Edge>Connections made.
edges_removed: Vec<Edge>Connections removed, in full.
The endpoints and kind are kept because the graph no longer has
them: working out what a severed objects edge orphaned means
walking down from a node the edge no longer points at. A
disconnect naming .all is expanded here into the edges it
actually removed, since the pattern cannot be re-expanded once
they are gone.
edges_rearmed: Vec<Edge>Connections whose arguments a repeated connect replaced in
place.
No edge appeared or disappeared, so a record keyed on additions
and removals misses this entirely – and ɴsɪ’s "priority"
rides on these arguments, which decides which of two shaders
wins. This is the quietest way for a scene to change meaning.
Implementations§
Source§impl Changes
impl Changes
Sourcepub fn was_created(&self, handle: &str) -> bool
pub fn was_created(&self, handle: &str) -> bool
Whether one handle was created in this interval.
Sourcepub fn deleted(&self) -> impl Iterator<Item = (&str, &str)>
pub fn deleted(&self) -> impl Iterator<Item = (&str, &str)>
The handles deleted, each with the node type it had.
Sourcepub fn deleted_type(&self, handle: &str) -> Option<&str>
pub fn deleted_type(&self, handle: &str) -> Option<&str>
The node type a deleted handle had, if it was deleted here.
Sourcepub fn attributes(&self) -> impl Iterator<Item = (&str, &str)>
pub fn attributes(&self) -> impl Iterator<Item = (&str, &str)>
The (handle, attribute) pairs set, re-set or deleted.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Nothing changed since the last Scene::take_changes.