-
Notifications
You must be signed in to change notification settings - Fork 441
Closed
Labels
F-trait-reworkFeature: Trait ReworkFeature: Trait Rework
Description
This proposes several new traits that are useful in manipulating existing graphs.
pub trait GraphMap {
type Output;
fn map<'a, F, G, N, E>(&self, nodes: F, edges: G) -> Self::Output<N, E>;
}
// mutable access could be modelled over `for node in g.nodes_mut() { node = ... }`
pub trait GraphFilterMap {
type Output;
fn filter_map<'a, F, G, N, E>(&self, nodes: F, edges: G) -> Self::Output<N, E>;
}
pub trait GraphRetain {
fn retain_nodes<F>(&mut self, visit: F);
fn retain_edges<F>(&mut self, visit: F);
}These are modeled after Graph (and StableGraph) as they are currently the most fully featured.
We might want to think about the following:
edge_connecting()contains_edge()find_edge()find_edge_undirected()externals()node_weights()node_weights_mut()neighbors_undirected()reverse()EntryAPI
On Graph, there are the following duplicates:
node_indices()->IntoNodeIdentifiers(deprecate)node_weight()-> Trait Rework: Graph fundamentals #556GraphAccess(deprecate)node_weight_mut()-> Trait Rework: Graph fundamentals #556GraphAccess(deprecate)edge_weight()-> Trait Rework: Graph fundamentals #556GraphAccess(deprecate)edge_weight_mut()-> Trait Rework: Graph fundamentals #556GraphAccess(deprecate)neighbors()->IntoNeighbors(deprecate)neighbors_undirected()->IntoNeighorsUndirected(deprecate)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
F-trait-reworkFeature: Trait ReworkFeature: Trait Rework