Struct rustc_lint::middle::graph::GraphUnstable
[-] [+]
[src]
pub struct Graph<N, E> { // some fields omitted }
Methods
impl<N, E> Graph<N, E>
fn new() -> Graph<N, E>
fn with_capacity(num_nodes: usize, num_edges: usize) -> Graph<N, E>
fn all_nodes(&'a self) -> &'a [Node<N>]
fn all_edges(&'a self) -> &'a [Edge<E>]
fn next_node_index(&self) -> NodeIndex
fn add_node(&mut self, data: N) -> NodeIndex
fn mut_node_data(&'a mut self, idx: NodeIndex) -> &'a mut N
fn node_data(&'a self, idx: NodeIndex) -> &'a N
fn node(&'a self, idx: NodeIndex) -> &'a Node<N>
fn next_edge_index(&self) -> EdgeIndex
fn add_edge(&mut self, source: NodeIndex, target: NodeIndex, data: E) -> EdgeIndex
fn mut_edge_data(&'a mut self, idx: EdgeIndex) -> &'a mut E
fn edge_data(&'a self, idx: EdgeIndex) -> &'a E
fn edge(&'a self, idx: EdgeIndex) -> &'a Edge<E>
fn first_adjacent(&self, node: NodeIndex, dir: Direction) -> EdgeIndex
Accesses the index of the first edge adjacent to node
.
This is useful if you wish to modify the graph while walking
the linked list of edges.
fn next_adjacent(&self, edge: EdgeIndex, dir: Direction) -> EdgeIndex
Accesses the next edge in a given direction. This is useful if you wish to modify the graph while walking the linked list of edges.
fn each_node<'a, F>(&'a self, f: F) -> bool where F: FnMut(NodeIndex, &'a Node<N>) -> bool
Iterates over all edges defined in the graph.
fn each_edge<'a, F>(&'a self, f: F) -> bool where F: FnMut(EdgeIndex, &'a Edge<E>) -> bool
Iterates over all edges defined in the graph
fn each_outgoing_edge<'a, F>(&'a self, source: NodeIndex, f: F) -> bool where F: FnMut(EdgeIndex, &'a Edge<E>) -> bool
Iterates over all outgoing edges from the node from
fn each_incoming_edge<'a, F>(&'a self, target: NodeIndex, f: F) -> bool where F: FnMut(EdgeIndex, &'a Edge<E>) -> bool
Iterates over all incoming edges to the node target
fn each_adjacent_edge<'a, F>(&'a self, node: NodeIndex, dir: Direction, f: F) -> bool where F: FnMut(EdgeIndex, &'a Edge<E>) -> bool
Iterates over all edges adjacent to the node node
in the direction dir
(either Outgoing
or `Incoming)