pub struct DependencyResolver { /* private fields */ }Expand description
Resolves dependency specs to local filesystem paths.
Implementations§
Source§impl DependencyResolver
impl DependencyResolver
Sourcepub fn new(project_root: PathBuf) -> Option<Self>
pub fn new(project_root: PathBuf) -> Option<Self>
Create a resolver for the given project root.
Uses ~/.shape/cache/ as the shared cache root. Returns None if the home
directory cannot be determined.
Sourcepub fn with_cache_dir(project_root: PathBuf, cache_dir: PathBuf) -> Self
pub fn with_cache_dir(project_root: PathBuf, cache_dir: PathBuf) -> Self
Create a resolver with an explicit cache directory (for testing).
Sourcepub fn with_paths(
project_root: PathBuf,
cache_dir: PathBuf,
registry_index_dir: PathBuf,
registry_src_dir: PathBuf,
) -> Self
pub fn with_paths( project_root: PathBuf, cache_dir: PathBuf, registry_index_dir: PathBuf, registry_src_dir: PathBuf, ) -> Self
Create a resolver with explicit cache + registry paths (for tests/tooling).
Sourcepub fn resolve(
&self,
deps: &HashMap<String, DependencySpec>,
) -> Result<Vec<ResolvedDependency>, String>
pub fn resolve( &self, deps: &HashMap<String, DependencySpec>, ) -> Result<Vec<ResolvedDependency>, String>
Resolve all dependencies, returning them in topological order.
Checks for circular dependencies among path deps, then performs a topological sort so that dependencies appear before their dependents.
Auto Trait Implementations§
impl Freeze for DependencyResolver
impl RefUnwindSafe for DependencyResolver
impl Send for DependencyResolver
impl Sync for DependencyResolver
impl Unpin for DependencyResolver
impl UnsafeUnpin for DependencyResolver
impl UnwindSafe for DependencyResolver
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