Function libcnb_package::find_cargo_workspace_root_dir

source ·
pub fn find_cargo_workspace_root_dir(
    dir_in_workspace: &Path
) -> Result<PathBuf, FindCargoWorkspaceRootError>
Expand description

Returns the path of the root workspace directory for a Rust Cargo project. This is often a useful starting point for detecting buildpacks with find_buildpack_dirs.

§Errors

Will return an Err if the root workspace directory can’t be located due to:

  • no CARGO environment variable with the path to the cargo binary
  • executing this function with a directory that is not within a Cargo project
  • any other file or system error that might occur