Skip to main content

scan

Function scan 

Source
pub fn scan<P: AsRef<Path>>(
    path: &P,
    options: &ScanOptions,
) -> impl Iterator<Item = Result<Project, ScanError>>
Expand description

Recursively scan path for projects, yielding each wrapped in a Result.

Hidden directories (name starting with .) and artifact directories (target, node_modules, build, … — see [ALL_ARTIFACT_DIR_NAMES]) are never descended into. Otherwise the traversal keeps descending even after finding a project, so nested projects are reported too — a Cargo workspace and each of its sub-crates, for example, are emitted separately (sub-crates with no artifacts of their own are dropped by analyze).

Traversal errors are reported per-entry via ScanError but do not stop iteration: use filter_map(Result::ok) to ignore them, or handle them explicitly.