pub struct GraphSnapshot {
pub revision: u64,
pub nodes: Vec<NodeInfo>,
pub edges: Vec<EdgeInfo>,
}Expand description
A consistent copy of the whole topology, taken under the graph’s lock and then read without it.
revision increments on every mutation, so two snapshots can be told apart
even when they describe the same shape. This is also what
crate::pipeline::Pipeline::topology renders and what a run/attach/
detach log record embeds.
Fields§
§revision: u64Monotonically increasing graph version. Each successful mutation increments it exactly once.
nodes: Vec<NodeInfo>Elements attached when this snapshot was taken.
edges: Vec<EdgeInfo>Connections attached when this snapshot was taken.
Implementations§
Source§impl GraphSnapshot
impl GraphSnapshot
Sourcepub fn node(&self, id: ElementId) -> Option<&NodeInfo>
pub fn node(&self, id: ElementId) -> Option<&NodeInfo>
Finds one node by stable identity within this snapshot.
Sourcepub fn terminal_ids(&self) -> Vec<ElementId>
pub fn terminal_ids(&self) -> Vec<ElementId>
Returns the attached terminal sinks in this snapshot.
A terminal has an incoming edge and no outgoing edge. An empty dynamic
crate::elements::Tee is excluded: it is a leaf in the drawing, but
has no terminal sink that can acknowledge preroll.
Trait Implementations§
Source§impl Clone for GraphSnapshot
impl Clone for GraphSnapshot
Source§fn clone(&self) -> GraphSnapshot
fn clone(&self) -> GraphSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more