Skip to main content

workspace_root_for

Function workspace_root_for 

Source
pub fn workspace_root_for(
    crate_manifest_dir: impl AsRef<Path>,
) -> Result<PathBuf>
Expand description

Ask Cargo for the workspace owning a crate manifest directory.

Cargo owns membership, explicit package.workspace, exclusions and nested independent workspaces. This performs an offline locate-project, without resolving dependencies or installing a toolchain. It never guesses from the directory layout or falls back to the supplied directory.

ยงErrors

Returns filesystem, Cargo invocation or invalid Cargo response errors.