Renamed FromGraph to GraphTopologyConversion to align with existing traits and separate from From trait
This commit is contained in:
+5
-4
@@ -17,14 +17,15 @@ pub use graph::{Graph, GraphEdgeMap, GraphIncidence, GraphVertexMap};
|
||||
|
||||
/// Builds a new graph isomorphic to `source`.
|
||||
///
|
||||
/// The resulting graph type `G` must implement [`GraphTopologyAddition`] which is used to add
|
||||
/// The resulting graph type `G` implements [`GraphTopologyAddition`] which is used to add
|
||||
/// vertices and edges. `on_edge` is called for each edge in `source` together with the
|
||||
/// corresponding new edge of the new graph, which callers can use to construct an edge mapping.
|
||||
///
|
||||
/// Used by the [`GraphTopologyAddition`] models' `From<&H>` and [`FromGraph`] implementations.
|
||||
/// Used by the [`GraphTopologyAddition`] models' `From<&H>` and [`GraphTopologyConversion`]
|
||||
/// implementations.
|
||||
///
|
||||
/// [`FromGraph`]: crate::traits::FromGraph
|
||||
pub(crate) fn build_from_topology<G: GraphTopologyAddition, H: GraphTopology>(
|
||||
/// [`GraphTopologyConversion`]: crate::traits::GraphTopologyConversion
|
||||
pub(crate) fn convert_to_addition<G: GraphTopologyAddition, H: GraphTopology>(
|
||||
source: &H,
|
||||
vertex_default: G::Vertex,
|
||||
mut on_edge: impl FnMut(H::Edge, G::Edge),
|
||||
|
||||
Reference in New Issue
Block a user