pub struct GraphDelta {
pub node_adds: Vec<(NodeId, HashMap<String, PropertyValue>)>,
pub node_removes: Vec<NodeId>,
pub node_updates: Vec<(NodeId, NodeDelta)>,
pub edge_adds: Vec<EdgeAddition>,
pub edge_removes: Vec<EdgeId>,
pub edge_updates: Vec<(EdgeId, EdgeDelta)>,
}Expand description
A graph delta representing changes to graph structure
Fields§
§node_adds: Vec<(NodeId, HashMap<String, PropertyValue>)>Node additions
node_removes: Vec<NodeId>Node removals
node_updates: Vec<(NodeId, NodeDelta)>Node property updates
edge_adds: Vec<EdgeAddition>Edge additions
edge_removes: Vec<EdgeId>Edge removals
edge_updates: Vec<(EdgeId, EdgeDelta)>Edge updates
Implementations§
Source§impl GraphDelta
impl GraphDelta
Sourcepub fn operation_count(&self) -> usize
pub fn operation_count(&self) -> usize
Get total number of operations
Sourcepub fn add_node(
&mut self,
id: NodeId,
properties: HashMap<String, PropertyValue>,
)
pub fn add_node( &mut self, id: NodeId, properties: HashMap<String, PropertyValue>, )
Add a node addition
Sourcepub fn remove_node(&mut self, id: NodeId)
pub fn remove_node(&mut self, id: NodeId)
Add a node removal
Sourcepub fn update_node(&mut self, id: NodeId, delta: NodeDelta)
pub fn update_node(&mut self, id: NodeId, delta: NodeDelta)
Add a node update
Sourcepub fn add_edge(&mut self, edge: EdgeAddition)
pub fn add_edge(&mut self, edge: EdgeAddition)
Add an edge
Sourcepub fn remove_edge(&mut self, id: EdgeId)
pub fn remove_edge(&mut self, id: EdgeId)
Remove an edge
Sourcepub fn update_edge(&mut self, id: EdgeId, delta: EdgeDelta)
pub fn update_edge(&mut self, id: EdgeId, delta: EdgeDelta)
Update an edge
Sourcepub fn compose(self, other: GraphDelta) -> Self
pub fn compose(self, other: GraphDelta) -> Self
Compose with another graph delta
Sourcepub fn affected_nodes(&self) -> HashSet<NodeId>
pub fn affected_nodes(&self) -> HashSet<NodeId>
Get affected node IDs
Sourcepub fn affected_edges(&self) -> HashSet<EdgeId>
pub fn affected_edges(&self) -> HashSet<EdgeId>
Get affected edge IDs
Trait Implementations§
Source§impl Clone for GraphDelta
impl Clone for GraphDelta
Source§impl Debug for GraphDelta
impl Debug for GraphDelta
Auto Trait Implementations§
impl Forget for GraphDelta
impl Freeze for GraphDelta
impl Move for GraphDelta
impl RefUnwindSafe for GraphDelta
impl Send for GraphDelta
impl Sync for GraphDelta
impl Unpin for GraphDelta
impl UnsafeUnpin for GraphDelta
impl UnwindSafe for GraphDelta
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