[][src]Struct cargo::util::graph::Graph

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

Methods

impl<N: Eq + Hash + Clone, E: Default> Graph<N, E>[src]

pub fn new() -> Graph<N, E>[src]

pub fn add(&mut self, node: N)[src]

pub fn contains<Q: ?Sized>(&self, k: &Q) -> bool where
    N: Borrow<Q>,
    Q: Hash + Eq
[src]

pub fn edge(&self, from: &N, to: &N) -> Option<&E>[src]

pub fn edges(&self, from: &N) -> impl Iterator<Item = (&N, &E)>[src]

pub fn sort(&self) -> Vec<N>[src]

A topological sort of the Graph

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

pub fn path_to_top<'a>(&'a self, pkg: &'a N) -> Vec<&'a N>[src]

Resolves one of the paths from the given dependent package up to the root.

Trait Implementations

impl<N: Eq + Hash, E: Eq> PartialEq<Graph<N, E>> for Graph<N, E>[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl<N: Eq + Hash + Clone, E: Default> Default for Graph<N, E>[src]

impl<N: Eq + Hash + Clone, E: Clone> Clone for Graph<N, E>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<N: Eq + Hash, E: Eq> Eq for Graph<N, E>[src]

impl<N: Display + Eq + Hash, E> Debug for Graph<N, E>[src]

Auto Trait Implementations

impl<N, E> Send for Graph<N, E> where
    E: Send,
    N: Send

impl<N, E> Sync for Graph<N, E> where
    E: Sync,
    N: Sync

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

impl<T, U> TryInto 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> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self