Implementations
sourceimpl Graph<PackageId, HashSet<Dependency>>
impl Graph<PackageId, HashSet<Dependency>>
sourceimpl<N: Eq + Ord + Clone, E: Default + Clone> Graph<N, E>
impl<N: Eq + Ord + Clone, E: Default + Clone> Graph<N, E>
pub fn new() -> Graph<N, E>
pub fn add(&mut self, node: N)
pub fn link(&mut self, node: N, child: N) -> &mut E
pub fn contains<Q: ?Sized>(&self, k: &Q) -> bool where
N: Borrow<Q>,
Q: Ord + Eq,
pub fn edge(&self, from: &N, to: &N) -> Option<&E>
pub fn edges(&self, from: &N) -> impl Iterator<Item = (&N, &E)>
sourcepub fn sort(&self) -> Vec<N>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn sort(&self) -> Vec<N>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
A topological sort of the Graph
pub fn iter(&self) -> impl Iterator<Item = &N>
sourcepub fn is_path_from_to<'a>(&'a self, from: &'a N, to: &'a N) -> bool
pub fn is_path_from_to<'a>(&'a self, from: &'a N, to: &'a N) -> bool
Checks if there is a path from from
to to
.
sourcepub fn path_to_bottom<'a>(&'a self, pkg: &'a N) -> Vec<(&'a N, Option<&'a E>)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn path_to_bottom<'a>(&'a self, pkg: &'a N) -> Vec<(&'a N, Option<&'a E>)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Resolves one of the paths from the given dependent package down to a leaf.
Each element contains a node along with an edge except the first one. The representation would look like:
(Node0,) -> (Node1, Edge01) -> (Node2, Edge12)…
sourcepub fn path_to_top<'a>(&'a self, pkg: &'a N) -> Vec<(&'a N, Option<&'a E>)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn path_to_top<'a>(&'a self, pkg: &'a N) -> Vec<(&'a N, Option<&'a E>)>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Resolves one of the paths from the given dependent package up to the root.
Each element contains a node along with an edge except the first one. The representation would look like:
(Node0,) -> (Node1, Edge01) -> (Node2, Edge12)…
Trait Implementations
impl<N: Eq + Ord + Clone, E: Eq + Clone> Eq for Graph<N, E>
Auto Trait Implementations
impl<N, E> RefUnwindSafe for Graph<N, E> where
E: RefUnwindSafe,
N: RefUnwindSafe,
impl<N, E> !Send for Graph<N, E>
impl<N, E> !Sync for Graph<N, E>
impl<N, E> Unpin for Graph<N, E> where
E: Unpin,
N: Unpin,
impl<N, E> UnwindSafe for Graph<N, E> where
E: UnwindSafe + RefUnwindSafe,
N: UnwindSafe + RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.