Add edge return type to GraphTopology::add_edge()

There is currently no use for the return type, but it will come.
This commit is contained in:
2026-04-22 14:28:21 +02:00
parent da9ba7b0ad
commit 9088dd4683
2 changed files with 7 additions and 3 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
pub trait GraphTopology {
type Vertex: Copy + Eq;
type Edge;
fn vertex_count(&self) -> usize;
fn edge_count(&self) -> usize;
@@ -8,5 +9,5 @@ pub trait GraphTopology {
fn vertices(&self) -> impl Iterator<Item = Self::Vertex>;
fn neighbors(&self, v: Self::Vertex) -> impl Iterator<Item = Self::Vertex>;
fn add_vertex(&mut self) -> Self::Vertex;
fn add_edge(&mut self, v1: Self::Vertex, v2: Self::Vertex);
fn add_edge(&mut self, v1: Self::Vertex, v2: Self::Vertex) -> Self::Edge;
}