Trait traitgraph::interface::MutableGraphContainer  
source · [−]pub trait MutableGraphContainer: ImmutableGraphContainer {
    fn add_node(&mut self, node_data: Self::NodeData) -> Self::NodeIndex;
    fn add_edge(
        &mut self, 
        from: Self::NodeIndex, 
        to: Self::NodeIndex, 
        edge_data: Self::EdgeData
    ) -> Self::EdgeIndex;
    fn remove_node(
        &mut self, 
        node_id: Self::NodeIndex
    ) -> Option<Self::NodeData>;
    fn remove_edge(
        &mut self, 
        edge_id: Self::EdgeIndex
    ) -> Option<Self::EdgeData>;
    fn remove_edges_sorted(&mut self, edge_ids: &[Self::EdgeIndex]);
    fn clear(&mut self);
    fn remove_nodes_sorted_slice(&mut self, node_ids: &[Self::NodeIndex]) { ... }
}Expand description
A container that allows adding and removing nodes and edges.
Required Methods
Adds a new node with the given NodeData to the graph.
Adds a new edge with the given EdgeData to the graph.
fn remove_node(&mut self, node_id: Self::NodeIndex) -> Option<Self::NodeData>
fn remove_node(&mut self, node_id: Self::NodeIndex) -> Option<Self::NodeData>
Removes the node with the given id from the graph. Note that this may change the ids of existing nodes.
fn remove_edge(&mut self, edge_id: Self::EdgeIndex) -> Option<Self::EdgeData>
fn remove_edge(&mut self, edge_id: Self::EdgeIndex) -> Option<Self::EdgeData>
Removes the edge with the given id from the graph. Note that this may change the ids of existing edges.
fn remove_edges_sorted(&mut self, edge_ids: &[Self::EdgeIndex])
fn remove_edges_sorted(&mut self, edge_ids: &[Self::EdgeIndex])
Removes the edges with the given ids from the graph. The ids are expected to be given in sorted order.
Note that this may change the ids of existing edges.
Provided Methods
fn remove_nodes_sorted_slice(&mut self, node_ids: &[Self::NodeIndex])
fn remove_nodes_sorted_slice(&mut self, node_ids: &[Self::NodeIndex])
Removes all nodes with the given ids from the graph. The nodes must be passed as a slice and sorted in ascending order. Note that this may change the ids of existing nodes.