pub struct DependencyGraph { /* private fields */ }Expand description
Dependency graph for managing skill dependencies
Implementations§
Source§impl DependencyGraph
impl DependencyGraph
Sourcepub fn add_skill(&mut self, skill_id: String, dependencies: Vec<Dependency>)
pub fn add_skill(&mut self, skill_id: String, dependencies: Vec<Dependency>)
Add a skill with its dependencies
Sourcepub fn build_graph(skills: Vec<(String, Vec<Dependency>)>) -> Self
pub fn build_graph(skills: Vec<(String, Vec<Dependency>)>) -> Self
Build graph from a list of (skill_id, dependencies) pairs
Sourcepub fn detect_cycles(&self) -> Result<(), DependencyError>
pub fn detect_cycles(&self) -> Result<(), DependencyError>
Detect circular dependencies
Sourcepub fn topological_sort(&self) -> Result<Vec<String>, DependencyError>
pub fn topological_sort(&self) -> Result<Vec<String>, DependencyError>
Topological sort for installation order Returns skills in dependency-first order (dependencies before dependents)
Sourcepub fn get_dependencies(&self, skill_id: &str) -> Option<&Vec<Dependency>>
pub fn get_dependencies(&self, skill_id: &str) -> Option<&Vec<Dependency>>
Get dependencies for a skill
Sourcepub fn get_dependents(&self, skill_id: &str) -> Vec<String>
pub fn get_dependents(&self, skill_id: &str) -> Vec<String>
Get all skills that depend on a given skill
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DependencyGraph
impl RefUnwindSafe for DependencyGraph
impl Send for DependencyGraph
impl Sync for DependencyGraph
impl Unpin for DependencyGraph
impl UnsafeUnpin for DependencyGraph
impl UnwindSafe for DependencyGraph
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 moreCreates a shared type from an unshared type.