[][src]Struct rustc_data_structures::graph::scc::Sccs

pub struct Sccs<N: Idx, S: Idx> { /* fields omitted */ }

Strongly connected components (SCC) of a graph. The type N is the index type for the graph nodes and S is the index type for the SCCs. We can map from each node to the SCC that it participates in, and we also have the successors of each SCC.

Methods

impl<N: Idx, S: Idx> Sccs<N, S>[src]

pub fn new(
    graph: &impl DirectedGraph<Node = N> + WithNumNodes + WithSuccessors
) -> Self
[src]

pub fn num_sccs(&self) -> usize[src]

Returns the number of SCCs in the graph.

pub fn all_sccs(&self) -> impl Iterator<Item = S>[src]

Returns an iterator over the SCCs in the graph.

pub fn scc(&self, r: N) -> S[src]

Returns the SCC to which a node r belongs.

Important traits for &'_ mut [u8]
pub fn successors(&self, scc: S) -> &[S][src]

Returns the successors of the given SCC.

pub fn reverse(&self) -> VecGraph<S>[src]

Construct the reverse graph of the SCC graph.

Trait Implementations

impl<N: Idx, S: Idx> DirectedGraph for Sccs<N, S>[src]

type Node = S

impl<N: Idx, S: Idx> WithNumNodes for Sccs<N, S>[src]

impl<N: Idx, S: Idx> WithNumEdges for Sccs<N, S>[src]

impl<N: Idx, S: Idx> WithSuccessors for Sccs<N, S>[src]

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

type Item = S

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

Auto Trait Implementations

impl<N, S> Send for Sccs<N, S> where
    S: Send

impl<N, S> Unpin for Sccs<N, S> where
    S: Unpin

impl<N, S> Sync for Sccs<N, S> where
    S: Sync

impl<N, S> UnwindSafe for Sccs<N, S> where
    S: UnwindSafe

impl<N, S> RefUnwindSafe for Sccs<N, S> where
    S: RefUnwindSafe

Blanket Implementations

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.

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

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

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

impl<E> SpecializationError for E[src]