pub struct NodeGraphChanges {
pub nodes: Vec<NodeChange>,
pub edges: Vec<EdgeChange>,
}Expand description
XyFlow-style node/edge projection of a graph patch.
This adapter is intentionally lossy: it only contains node and edge changes. Use
crate::runtime::commit::NodeGraphPatch when a consumer must observe full graph resources
such as ports, groups, sticky notes, imports, or symbols.
Fields§
§nodes: Vec<NodeChange>§edges: Vec<EdgeChange>Implementations§
Source§impl NodeGraphChanges
impl NodeGraphChanges
pub fn from_parts(nodes: Vec<NodeChange>, edges: Vec<EdgeChange>) -> Self
pub fn into_parts(self) -> (Vec<NodeChange>, Vec<EdgeChange>)
pub fn is_empty(&self) -> bool
pub fn nodes(&self) -> &[NodeChange]
pub fn edges(&self) -> &[EdgeChange]
pub fn from_patch(patch: &NodeGraphPatch) -> Self
Sourcepub fn from_transaction(tx: &GraphTransaction) -> Self
pub fn from_transaction(tx: &GraphTransaction) -> Self
Derives change events from a reversible graph transaction.
This is intended for XyFlow-style callbacks such as “on_nodes_change”.
Sourcepub fn to_transaction(
&self,
graph: &Graph,
) -> Result<GraphTransaction, ChangesToTransactionError>
pub fn to_transaction( &self, graph: &Graph, ) -> Result<GraphTransaction, ChangesToTransactionError>
Converts change events into a reversible transaction by looking up “from” values in the current graph.
This enables an XyFlow-like runtime to accept (NodeChange, EdgeChange) and still keep
GraphHistory undo/redo semantics.
Trait Implementations§
Source§impl Clone for NodeGraphChanges
impl Clone for NodeGraphChanges
Source§fn clone(&self) -> NodeGraphChanges
fn clone(&self) -> NodeGraphChanges
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NodeGraphChanges
impl Debug for NodeGraphChanges
Source§impl Default for NodeGraphChanges
impl Default for NodeGraphChanges
Source§fn default() -> NodeGraphChanges
fn default() -> NodeGraphChanges
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NodeGraphChanges
impl RefUnwindSafe for NodeGraphChanges
impl Send for NodeGraphChanges
impl Sync for NodeGraphChanges
impl Unpin for NodeGraphChanges
impl UnsafeUnpin for NodeGraphChanges
impl UnwindSafe for NodeGraphChanges
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
Mutably borrows from an owned value. Read more