pub struct ProjectReferenceGraph { /* private fields */ }Expand description
Graph of project references for build ordering
Implementations§
Source§impl ProjectReferenceGraph
impl ProjectReferenceGraph
Sourcepub fn load(root_config_path: &Path) -> Result<Self>
pub fn load(root_config_path: &Path) -> Result<Self>
Load a project reference graph starting from a root tsconfig
Sourcepub fn get_project(&self, id: ProjectId) -> Option<&ResolvedProject>
pub fn get_project(&self, id: ProjectId) -> Option<&ResolvedProject>
Get project by ID
Sourcepub fn get_project_id(&self, config_path: &Path) -> Option<ProjectId>
pub fn get_project_id(&self, config_path: &Path) -> Option<ProjectId>
Get project ID by config path
Sourcepub fn projects(&self) -> &[ResolvedProject]
pub fn projects(&self) -> &[ResolvedProject]
Get all projects
Sourcepub const fn project_count(&self) -> usize
pub const fn project_count(&self) -> usize
Get the number of projects
Sourcepub fn get_references(&self, id: ProjectId) -> &[ProjectId] ⓘ
pub fn get_references(&self, id: ProjectId) -> &[ProjectId] ⓘ
Get direct references of a project
Sourcepub fn get_dependents(&self, id: ProjectId) -> &[ProjectId] ⓘ
pub fn get_dependents(&self, id: ProjectId) -> &[ProjectId] ⓘ
Get direct dependents of a project (projects that reference it)
Sourcepub fn detect_cycles(&self) -> Vec<Vec<ProjectId>>
pub fn detect_cycles(&self) -> Vec<Vec<ProjectId>>
Check for circular references
Sourcepub fn build_order(&self) -> Result<Vec<ProjectId>>
pub fn build_order(&self) -> Result<Vec<ProjectId>>
Get a topologically sorted build order Returns Err if there are cycles that prevent ordering
Sourcepub fn transitive_dependencies(&self, id: ProjectId) -> FxHashSet<ProjectId>
pub fn transitive_dependencies(&self, id: ProjectId) -> FxHashSet<ProjectId>
Get all transitive dependencies of a project
Sourcepub fn affected_projects(&self, id: ProjectId) -> FxHashSet<ProjectId>
pub fn affected_projects(&self, id: ProjectId) -> FxHashSet<ProjectId>
Get all projects that would be affected by changes in a project
Trait Implementations§
Source§impl Debug for ProjectReferenceGraph
impl Debug for ProjectReferenceGraph
Source§impl Default for ProjectReferenceGraph
impl Default for ProjectReferenceGraph
Source§fn default() -> ProjectReferenceGraph
fn default() -> ProjectReferenceGraph
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProjectReferenceGraph
impl RefUnwindSafe for ProjectReferenceGraph
impl Send for ProjectReferenceGraph
impl Sync for ProjectReferenceGraph
impl Unpin for ProjectReferenceGraph
impl UnsafeUnpin for ProjectReferenceGraph
impl UnwindSafe for ProjectReferenceGraph
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