Struct rustc_data_structures::graph::Graph [−] [src]

pub struct Graph<N, E> {
    // some fields omitted
}
Unstable

Methods

impl<N: Debug, E: Debug> Graph<N, E>

fn new() -> Graph<N, E>

Unstable

fn all_nodes<'a>(&'a self) -> &'a [Node<N>]

Unstable

fn all_edges<'a>(&'a self) -> &'a [Edge<E>]

Unstable

fn next_node_index(&self) -> NodeIndex

Unstable

fn add_node(&mut self, data: N) -> NodeIndex

Unstable

fn mut_node_data<'a>(&'a mut self, idx: NodeIndex) -> &'a mut N

Unstable

fn node_data<'a>(&'a self, idx: NodeIndex) -> &'a N

Unstable

fn node<'a>(&'a self, idx: NodeIndex) -> &'a Node<N>

Unstable

fn next_edge_index(&self) -> EdgeIndex

Unstable

fn add_edge(&mut self, source: NodeIndex, target: NodeIndex, data: E) -> EdgeIndex

Unstable

fn mut_edge_data<'a>(&'a mut self, idx: EdgeIndex) -> &'a mut E

Unstable

fn edge_data<'a>(&'a self, idx: EdgeIndex) -> &'a E

Unstable

fn edge<'a>(&'a self, idx: EdgeIndex) -> &'a Edge<E>

Unstable

fn first_adjacent(&self, node: NodeIndex, dir: Direction) -> EdgeIndex

Unstable

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

Unstable

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

Unstable

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

Unstable

Iterates over all edges defined in the graph

fn outgoing_edges(&self, source: NodeIndex) -> AdjacentEdges<N, E>

Unstable

fn incoming_edges(&self, source: NodeIndex) -> AdjacentEdges<N, E>

Unstable

fn adjacent_edges(&self, source: NodeIndex, direction: Direction) -> AdjacentEdges<N, E>

Unstable

fn successor_nodes<'a>(&'a self, source: NodeIndex) -> AdjacentTargets<N, E>

Unstable

fn predecessor_nodes<'a>(&'a self, target: NodeIndex) -> AdjacentSources<N, E>

Unstable

fn iterate_until_fixed_point<'a, F>(&'a self, op: F) where F: FnMut(usize, EdgeIndex, &'a Edge<E>) -> bool

Unstable

fn depth_traverse<'a>(&'a self, start: NodeIndex) -> DepthFirstTraversal<'a, N, E>

Unstable