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
.
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 · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more