pub struct DependencyAnalyzer { /* private fields */ }Expand description
Analyzer for crate dependencies using cargo_metadata
Implementations§
Source§impl DependencyAnalyzer
impl DependencyAnalyzer
Sourcepub fn from_manifest(manifest_path: &Path) -> Result<Self>
pub fn from_manifest(manifest_path: &Path) -> Result<Self>
Create a new dependency analyzer from a Cargo.toml path
Sourcepub fn from_current_dir() -> Result<Self>
pub fn from_current_dir() -> Result<Self>
Create a new dependency analyzer from the current directory
Sourcepub fn root_package(&self) -> Option<CrateInfo>
pub fn root_package(&self) -> Option<CrateInfo>
Get the root package (if this is a single-crate project)
Sourcepub fn get_crate_info(&self, name: &str) -> Option<CrateInfo>
pub fn get_crate_info(&self, name: &str) -> Option<CrateInfo>
Get information about a specific crate
Sourcepub fn all_packages(&self) -> Vec<CrateInfo>
pub fn all_packages(&self) -> Vec<CrateInfo>
Get all packages in the workspace
Sourcepub fn direct_dependencies(&self, name: &str) -> Vec<DependencyInfo>
pub fn direct_dependencies(&self, name: &str) -> Vec<DependencyInfo>
Get direct dependencies of a crate
Sourcepub fn dependency_tree(&self, root: &str) -> Vec<(String, usize)>
pub fn dependency_tree(&self, root: &str) -> Vec<(String, usize)>
Get the dependency tree as a flat list with depth indicators
Sourcepub fn total_dependency_count(&self, name: &str) -> usize
pub fn total_dependency_count(&self, name: &str) -> usize
Get total number of dependencies (transitive)
Auto Trait Implementations§
impl Freeze for DependencyAnalyzer
impl RefUnwindSafe for DependencyAnalyzer
impl Send for DependencyAnalyzer
impl Sync for DependencyAnalyzer
impl Unpin for DependencyAnalyzer
impl UnwindSafe for DependencyAnalyzer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more