pub struct GraphDiff { /* private fields */ }Expand description
The edges added and removed between two graphs over the same nodes, as
graphs::diff returns them.
Each edge comes with its edge index in the graph it belongs to: an added edge with its edge index
in the newer graph, a removed edge with its edge index in the older one. With these edge indices,
the caller can look up data on the edges of either graph in arrays indexed by edge index. Both
lists are in edge index order. To see whether a graph changed without keeping the older one,
compare hashes from graphs::topology_hash instead.
Instances are immutable and safe to share between threads (Send and Sync).
Memory: 12 bytes per added or removed edge.
Implementations§
Source§impl GraphDiff
impl GraphDiff
Sourcepub fn added_edges(&self) -> &Edges
pub fn added_edges(&self) -> &Edges
Returns the edges of the newer graph that the older one does not have, with their edge indices in the newer graph, in edge index order.
Time: O(1).
Sourcepub fn removed_edges(&self) -> &Edges
pub fn removed_edges(&self) -> &Edges
Returns the edges of the older graph that the newer one does not have, with their edge indices in the older graph, in edge index order.
Time: O(1).
Trait Implementations§
Source§impl Display for GraphDiff
Writes the numbers of added and removed edges, for debuggers and logs.
impl Display for GraphDiff
Writes the numbers of added and removed edges, for debuggers and logs.
Time: O(1).