pub struct Graph<N: Clone, E: Clone> { /* private fields */ }Implementations§
Source§impl<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>(&self, k: &Q) -> bool
pub fn edge(&self, from: &N, to: &N) -> Option<&E>
pub fn edges(&self, from: &N) -> impl Iterator<Item = &(N, E)>
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>
pub fn path_to_bottom<'a>(&'a self, pkg: &'a N) -> Vec<&'a N>
Resolves one of the paths from the given dependent package down to a leaf.
Sourcepub fn path_to_top<'a>(&'a self, pkg: &'a N) -> Vec<&'a N>
pub fn path_to_top<'a>(&'a self, pkg: &'a N) -> Vec<&'a N>
Resolves one of the paths from the given dependent package up to the root.
Trait Implementations§
impl<N: Eq + Ord + Clone, E: Eq + Clone> Eq for Graph<N, E>
Auto Trait Implementations§
impl<N, E> Freeze for Graph<N, E>
impl<N, E> RefUnwindSafe for Graph<N, E>where
N: RefUnwindSafe,
E: 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>
impl<N, E> UnwindSafe for Graph<N, E>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more