Skip to main content

Changes

Struct Changes 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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

Source

pub fn created(&self) -> impl Iterator<Item = &str>

The handles created and not since deleted.

Source

pub fn was_created(&self, handle: &str) -> bool

Whether one handle was created in this interval.

Source

pub fn deleted(&self) -> impl Iterator<Item = (&str, &str)>

The handles deleted, each with the node type it had.

Source

pub fn deleted_type(&self, handle: &str) -> Option<&str>

The node type a deleted handle had, if it was deleted here.

Source

pub fn attributes(&self) -> impl Iterator<Item = (&str, &str)>

The (handle, attribute) pairs set, re-set or deleted.

Source

pub fn is_empty(&self) -> bool

Nothing changed since the last Scene::take_changes.

Trait Implementations§

Source§

impl Clone for Changes

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 Changes

Source§

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

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

impl Default for Changes

Source§

fn default() -> Self

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

impl PartialEq for Changes

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 Changes

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