-
Notifications
You must be signed in to change notification settings - Fork 441
Closed
Labels
F-trait-reworkFeature: Trait ReworkFeature: Trait Rework
Description
Unify EdgeCount and NodeCount into GraphLen, as it is unlikely that there are any cases where only one of them is implemented.
Count is also used in the contexts of iterators for getting the length while consuming the iterator.
pub struct Length {
edges: usize,
nodes: usize
}
impl Length {
fn new() -> Self;
fn edges() -> usize;
fn nodes() -> usize;
}
pub trait GraphEdgeLen {
fn edges_len(&self) -> usize;
}
pub trait GraphNodeLen {
fn nodes_len(&self) -> usize;
}
pub trait GraphLen: GraphEdgeLen + GraphNodeLen {
fn len(&self) -> Length {
Length {edges: self.edges_len(), nodes: self.nodes_len()}
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
F-trait-reworkFeature: Trait ReworkFeature: Trait Rework