pub struct MergeGraph { /* private fields */ }Expand description
A directed graph supporting merge operations.
Implementations§
Source§impl MergeGraph
impl MergeGraph
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Return the number of nodes.
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Return the number of edges.
Sourcepub fn has_node(&self, id: MergeNodeId) -> bool
pub fn has_node(&self, id: MergeNodeId) -> bool
Check if a node exists in the graph.
Sourcepub fn get_node(&self, id: MergeNodeId) -> Option<&MergeNode>
pub fn get_node(&self, id: MergeNodeId) -> Option<&MergeNode>
Get a reference to a node by ID.
Sourcepub fn node_ids(&self) -> Vec<MergeNodeId>
pub fn node_ids(&self) -> Vec<MergeNodeId>
Return all node IDs, sorted.
Sourcepub fn next_id(&self) -> MergeNodeId
pub fn next_id(&self) -> MergeNodeId
Return the next available ID (max + 1).
Sourcepub fn merge(
&mut self,
other: &MergeGraph,
config: &MergeConfig,
) -> Result<MergeMapping, MergeError>
pub fn merge( &mut self, other: &MergeGraph, config: &MergeConfig, ) -> Result<MergeMapping, MergeError>
Merge another graph into this one using the given configuration.
Sourcepub fn edge_pairs(&self) -> HashSet<(MergeNodeId, MergeNodeId)>
pub fn edge_pairs(&self) -> HashSet<(MergeNodeId, MergeNodeId)>
Return the set of edges as (from, to) pairs.
Sourcepub fn adjacency_list(&self) -> HashMap<MergeNodeId, Vec<MergeNodeId>>
pub fn adjacency_list(&self) -> HashMap<MergeNodeId, Vec<MergeNodeId>>
Return the adjacency list representation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MergeGraph
impl RefUnwindSafe for MergeGraph
impl Send for MergeGraph
impl Sync for MergeGraph
impl Unpin for MergeGraph
impl UnsafeUnpin for MergeGraph
impl UnwindSafe for MergeGraph
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more