Struct scc_trait::Components

source ·
pub struct Components<V> { /* private fields */ }
Expand description

Strongly connected components.

Implementations§

source§

impl<V> Components<V>

source

pub fn len(&self) -> usize

Returns the number of strongly connected components.

source

pub fn is_empty(&self) -> bool

Checks if there are no components.

source

pub fn iter(&self) -> impl Iterator<Item = &[V]>

Returns an iterator over the strongly connected components.

source

pub fn vertex_component_index(&self, v: &V) -> Option<usize>
where V: Eq + Hash,

Returns the index of the given vertex’s strongly connected component.

source

pub fn get_by_index(&self, i: usize) -> Option<&[V]>

Returns the component with the given index i.

source

pub fn get(&self, v: &V) -> Option<&[V]>
where V: Eq + Hash,

Return the given vertex’s strongly connected component.

source

pub fn successors(&self, i: usize) -> Option<impl '_ + Iterator<Item = usize>>

source

pub fn is_cyclic(&self, i: usize) -> bool

source

pub fn direct_successors(&self, i: usize) -> Option<HashSet<usize>>

source

pub fn depths(&self) -> Vec<usize>

Returns the depth of each component.

The depth of a component is the maximum of the depth of its predecessors plus 1. A component with no predecessors has depth 0.

source

pub fn predecessors(&self) -> Vec<HashSet<usize>>

source

pub fn order_by_depth(&self) -> Vec<usize>

Order components by depth.

The depth of a component is the maximum of the depth of its predecessors plus 1. A component with no predecessors has depth 0.

Auto Trait Implementations§

§

impl<V> Freeze for Components<V>

§

impl<V> RefUnwindSafe for Components<V>
where V: RefUnwindSafe,

§

impl<V> Send for Components<V>
where V: Send,

§

impl<V> Sync for Components<V>
where V: Sync,

§

impl<V> Unpin for Components<V>
where V: Unpin,

§

impl<V> UnwindSafe for Components<V>
where V: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.