[−][src]Struct rustc_data_structures::graph::vec_graph::VecGraph

pub struct VecGraph<N: Idx> {
    node_starts: IndexVec<N, usize>,
    edge_targets: Vec<N>,
}

Fields

node_starts: IndexVec<N, usize>

Maps from a given node to an index where the set of successors for that node starts. The index indexes into the edges vector. To find the range for a given node, we look up the start for that node and then the start for the next node (i.e., with an index 1 higher) and get the range between the two. This vector always has an extra entry so that this works even for the max element.

edge_targets: Vec<N>

Implementations

impl<N: Idx> VecGraph<N>[src]

pub fn new(num_nodes: usize, edge_pairs: Vec<(N, N)>) -> Self[src]

pub fn successors(&self, source: N) -> &[N][src]

Gets the successors for source as a slice.

Trait Implementations

impl<N: Idx> DirectedGraph for VecGraph<N>[src]

type Node = N

impl<N: Idx, 'graph> GraphSuccessors<'graph> for VecGraph<N>[src]

type Item = N

type Iter = Cloned<Iter<'graph, N>>

impl<N: Idx> WithNumEdges for VecGraph<N>[src]

impl<N: Idx> WithNumNodes for VecGraph<N>[src]

impl<N: Idx> WithSuccessors for VecGraph<N>[src]

Auto Trait Implementations

impl<N> RefUnwindSafe for VecGraph<N> where
    N: RefUnwindSafe, 

impl<N> Send for VecGraph<N> where
    N: Send, 

impl<N> Sync for VecGraph<N> where
    N: Sync, 

impl<N> Unpin for VecGraph<N> where
    N: Unpin, 

impl<N> UnwindSafe for VecGraph<N> where
    N: UnwindSafe, 

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized, 
[src]

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.