pub struct ProjectGraphBuilder { /* private fields */ }Expand description
Immutable query builder for dependency-graph snapshots and reports.
Implementations§
Source§impl ProjectGraphBuilder
impl ProjectGraphBuilder
Sourcepub fn include_external_dependencies(self) -> Self
pub fn include_external_dependencies(self) -> Self
Includes Cargo-visible external dependency targets and edges.
Sourcepub fn include_self_dependencies(self) -> Self
pub fn include_self_dependencies(self) -> Self
Includes extracted marker self-edges and self-edges produced by collapsing.
Sourcepub fn focus_on(self, pattern: impl Into<PatternSpec>, depth: usize) -> Self
pub fn focus_on(self, pattern: impl Into<PatternSpec>, depth: usize) -> Self
Keeps matching nodes and their undirected neighbors up to depth hops away.
Sourcepub fn reachable_from(self, pattern: impl Into<PatternSpec>) -> Self
pub fn reachable_from(self, pattern: impl Into<PatternSpec>) -> Self
Keeps matching nodes and every transitive outgoing dependency.
Sourcepub fn dependents_of(self, pattern: impl Into<PatternSpec>) -> Self
pub fn dependents_of(self, pattern: impl Into<PatternSpec>) -> Self
Keeps matching nodes and every transitive incoming dependent.
Sourcepub fn collapse_to_folder_depth(self, depth: usize) -> Self
pub fn collapse_to_folder_depth(self, depth: usize) -> Self
Collapses file nodes to their containing folder at a positive leading path depth.
Sourcepub fn collapse_by_pattern(self, expression: impl AsRef<str>) -> Self
pub fn collapse_by_pattern(self, expression: impl AsRef<str>) -> Self
Collapses nodes with a regular expression and the first capture ($1) as their label.
Sourcepub fn collapse_by_pattern_with_replacement(
self,
expression: impl AsRef<str>,
replacement: impl Into<String>,
) -> Self
pub fn collapse_by_pattern_with_replacement( self, expression: impl AsRef<str>, replacement: impl Into<String>, ) -> Self
Collapses nodes with explicit Rust regex capture-replacement syntax.
Sourcepub fn with_check_options(self, options: CheckOptions) -> Self
pub fn with_check_options(self, options: CheckOptions) -> Self
Replaces the extraction options used by snapshot terminals.
Sourcepub fn snapshot(&self) -> Result<GraphReportSnapshot, ArchUnitError>
pub fn snapshot(&self) -> Result<GraphReportSnapshot, ArchUnitError>
Extracts the project and returns the renderer-neutral queried snapshot.
Sourcepub fn summary(&self) -> Result<GraphReportSummary, ArchUnitError>
pub fn summary(&self) -> Result<GraphReportSummary, ArchUnitError>
Extracts the project and returns only the queried snapshot counts.
Sourcepub fn render(&self, format: GraphReportFormat) -> Result<String, ArchUnitError>
pub fn render(&self, format: GraphReportFormat) -> Result<String, ArchUnitError>
Extracts once and renders the queried snapshot as format.
Sourcepub fn to_dot(&self) -> Result<String, ArchUnitError>
pub fn to_dot(&self) -> Result<String, ArchUnitError>
Extracts once and renders Graphviz DOT.
Sourcepub fn to_mermaid(&self) -> Result<String, ArchUnitError>
pub fn to_mermaid(&self) -> Result<String, ArchUnitError>
Extracts once and renders Mermaid flowchart source.
Sourcepub fn to_d2(&self) -> Result<String, ArchUnitError>
pub fn to_d2(&self) -> Result<String, ArchUnitError>
Extracts once and renders D2 diagram source.
Sourcepub fn to_csv(&self) -> Result<String, ArchUnitError>
pub fn to_csv(&self) -> Result<String, ArchUnitError>
Extracts once and renders aggregated dependency CSV.
Sourcepub fn to_json(&self) -> Result<String, ArchUnitError>
pub fn to_json(&self) -> Result<String, ArchUnitError>
Extracts once and renders complete snapshot JSON.
Sourcepub fn to_html(&self) -> Result<String, ArchUnitError>
pub fn to_html(&self) -> Result<String, ArchUnitError>
Extracts once and renders a self-contained offline HTML report.
Sourcepub fn export(
&self,
format: GraphReportFormat,
output_path: impl AsRef<Path>,
) -> Result<(), ArchUnitError>
pub fn export( &self, format: GraphReportFormat, output_path: impl AsRef<Path>, ) -> Result<(), ArchUnitError>
Extracts once, renders format, and writes it as UTF-8.
Sourcepub fn export_as_dot(
&self,
output_path: impl AsRef<Path>,
) -> Result<(), ArchUnitError>
pub fn export_as_dot( &self, output_path: impl AsRef<Path>, ) -> Result<(), ArchUnitError>
Extracts once and exports Graphviz DOT as UTF-8.
Sourcepub fn export_as_mermaid(
&self,
output_path: impl AsRef<Path>,
) -> Result<(), ArchUnitError>
pub fn export_as_mermaid( &self, output_path: impl AsRef<Path>, ) -> Result<(), ArchUnitError>
Extracts once and exports Mermaid flowchart source as UTF-8.
Sourcepub fn export_as_d2(
&self,
output_path: impl AsRef<Path>,
) -> Result<(), ArchUnitError>
pub fn export_as_d2( &self, output_path: impl AsRef<Path>, ) -> Result<(), ArchUnitError>
Extracts once and exports D2 diagram source as UTF-8.
Sourcepub fn export_as_csv(
&self,
output_path: impl AsRef<Path>,
) -> Result<(), ArchUnitError>
pub fn export_as_csv( &self, output_path: impl AsRef<Path>, ) -> Result<(), ArchUnitError>
Extracts once and exports aggregated dependency CSV as UTF-8.
Sourcepub fn export_as_json(
&self,
output_path: impl AsRef<Path>,
) -> Result<(), ArchUnitError>
pub fn export_as_json( &self, output_path: impl AsRef<Path>, ) -> Result<(), ArchUnitError>
Extracts once and exports complete snapshot JSON as UTF-8.
Sourcepub fn export_as_html(
&self,
output_path: impl AsRef<Path>,
) -> Result<(), ArchUnitError>
pub fn export_as_html( &self, output_path: impl AsRef<Path>, ) -> Result<(), ArchUnitError>
Extracts once and exports a self-contained offline HTML report as UTF-8.
Sourcepub const fn project_locator(&self) -> &ProjectLocator
pub const fn project_locator(&self) -> &ProjectLocator
Returns where Cargo project discovery begins.
Sourcepub const fn options(&self) -> &GraphQueryOptions
pub const fn options(&self) -> &GraphQueryOptions
Returns the immutable graph query options.
Sourcepub const fn check_options(&self) -> &CheckOptions
pub const fn check_options(&self) -> &CheckOptions
Returns the immutable extraction options.
Trait Implementations§
Source§impl Clone for ProjectGraphBuilder
impl Clone for ProjectGraphBuilder
Source§fn clone(&self) -> ProjectGraphBuilder
fn clone(&self) -> ProjectGraphBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more