pub struct ProjectGraph { /* private fields */ }Expand description
A directed acyclic graph of project dependencies.
Implementations§
Source§impl ProjectGraph
impl ProjectGraph
Sourcepub fn build(projects: Vec<ProjectConfig>) -> Result<Self, GraphError>
pub fn build(projects: Vec<ProjectConfig>) -> Result<Self, GraphError>
Build a project dependency graph from discovered projects.
Validates that all dependency references are valid and that no cycles exist.
Sourcepub fn topological_order(&self) -> Result<Vec<&ProjectName>, GraphError>
pub fn topological_order(&self) -> Result<Vec<&ProjectName>, GraphError>
Returns all projects in topological order (dependencies before dependents).
Sourcepub fn get(&self, name: &ProjectName) -> Option<&ProjectConfig>
pub fn get(&self, name: &ProjectName) -> Option<&ProjectConfig>
Get a project configuration by name.
Sourcepub fn project_names(&self) -> impl Iterator<Item = &ProjectName>
pub fn project_names(&self) -> impl Iterator<Item = &ProjectName>
Get all project names.
Sourcepub fn dependencies(&self, name: &ProjectName) -> Option<&HashSet<ProjectName>>
pub fn dependencies(&self, name: &ProjectName) -> Option<&HashSet<ProjectName>>
Get the direct dependencies of a project.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProjectGraph
impl RefUnwindSafe for ProjectGraph
impl Send for ProjectGraph
impl Sync for ProjectGraph
impl Unpin for ProjectGraph
impl UnsafeUnpin for ProjectGraph
impl UnwindSafe for ProjectGraph
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