pub struct GraphDiff {
pub add_nodes: Vec<Node>,
pub remove_nodes: Vec<Uuid>,
pub add_links: Vec<Link>,
pub remove_links: Vec<Port>,
pub set_predetermined: Vec<(Port, Option<String>)>,
pub set_root: Option<Uuid>,
pub variables: HashMap<Uuid, String>,
}Expand description
An edit to a Graph: what to add and remove.
Applied in a fixed order (removals of links, then nodes; additions of nodes,
then links; then predetermined-key and root/variable settings) so a single
diff can both delete and rebuild a region. Loading a fresh behavior is
Graph::applying a diff whose add_nodes/add_links describe the whole
graph onto an Graph::empty graph.
Fields§
§add_nodes: Vec<Node>Nodes to insert (replacing any node with the same id).
remove_nodes: Vec<Uuid>Node ids to remove. Links touching a removed node are dropped too.
add_links: Vec<Link>Links to insert. Adding a link whose target already has one replaces it
(at most one link per input).
remove_links: Vec<Port>Link targets to unwire.
set_predetermined: Vec<(Port, Option<String>)>Predetermined-key overrides: set (Some) or clear (None) the
Io::predetermined_key of the slot at each Port.
set_root: Option<Uuid>If set, becomes the graph’s root.
variables: HashMap<Uuid, String>Named variables to declare/rename (id -> name), merged in.