pub struct NormalizedGraph<'a> { /* private fields */ }Expand description
Reverse-dependency graph over discovered packages.
NormalizedGraph borrows string slices from the input PackageRecord and
DependencyEdge slices. It must be consumed (queried and dropped) before
the input data goes out of scope. If you need to store the graph across
async boundaries or function returns, clone the relevant data first.
Implementations§
Source§impl<'a> NormalizedGraph<'a>
impl<'a> NormalizedGraph<'a>
Sourcepub fn new(
packages: &'a [PackageRecord],
dependency_edges: &'a [DependencyEdge],
) -> Self
pub fn new( packages: &'a [PackageRecord], dependency_edges: &'a [DependencyEdge], ) -> Self
Build a reverse-dependency graph from discovered packages and edges.
Sourcepub fn direct_dependents(&self, package_id: &str) -> Vec<&'a str>
pub fn direct_dependents(&self, package_id: &str) -> Vec<&'a str>
Return the packages that directly depend on package_id.
Sourcepub fn transitive_dependents(&self, package_id: &str) -> BTreeSet<&'a str>
pub fn transitive_dependents(&self, package_id: &str) -> BTreeSet<&'a str>
Return the transitive dependent closure for package_id.
Trait Implementations§
Source§impl<'a> Clone for NormalizedGraph<'a>
impl<'a> Clone for NormalizedGraph<'a>
Source§fn clone(&self) -> NormalizedGraph<'a>
fn clone(&self) -> NormalizedGraph<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for NormalizedGraph<'a>
impl<'a> RefUnwindSafe for NormalizedGraph<'a>
impl<'a> Send for NormalizedGraph<'a>
impl<'a> Sync for NormalizedGraph<'a>
impl<'a> Unpin for NormalizedGraph<'a>
impl<'a> UnsafeUnpin for NormalizedGraph<'a>
impl<'a> UnwindSafe for NormalizedGraph<'a>
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