pub struct DependencyResolver { /* private fields */ }Expand description
Resolves a dependency graph for a set of root SkillEntry items.
Uses breadth-first traversal so that depth is counted from the root, matching the behaviour described in the spec (decision #5).
Implementations§
Source§impl DependencyResolver
impl DependencyResolver
Sourcepub async fn resolve_dependencies(
&mut self,
initial_entries: Vec<SkillEntry>,
skills_dir: &Path,
) -> Result<Vec<SkillInstallItem>, DependencyResolutionError>
pub async fn resolve_dependencies( &mut self, initial_entries: Vec<SkillEntry>, skills_dir: &Path, ) -> Result<Vec<SkillInstallItem>, DependencyResolutionError>
Resolve the full dependency graph starting from initial_entries.
After each skill is installed it is expected to live at
<skills_dir>/<skill_id>/skill-project.toml. If that file is absent
the skill contributes zero transitive dependencies (graceful
degradation per the spec).
Sourcepub fn topological_sort(
&self,
items: Vec<SkillInstallItem>,
) -> Vec<SkillInstallItem>
pub fn topological_sort( &self, items: Vec<SkillInstallItem>, ) -> Vec<SkillInstallItem>
Return the skills in dependency-first (topological) order.
The BFS traversal already yields parents before children, so this is a no-op structurally; the method exists as the public API surface specified in §5.1 and can be extended later if needed.
Trait Implementations§
Source§impl Clone for DependencyResolver
impl Clone for DependencyResolver
Source§fn clone(&self) -> DependencyResolver
fn clone(&self) -> DependencyResolver
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 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreCreates a shared type from an unshared type.