Skip to main content

probe

Function probe 

Source
pub fn probe<E>(
    root_manifest: &Path,
    list_flags: &[&str],
    cargo: impl FnMut(&[&str]) -> Result<Answer, E>,
) -> Result<Probe, E>
Expand description

Read the file list of the sole default package rooted at root_manifest.

cargo package --list prints one path per line for one package and emits no stable delimiter when it selects several, and a nested package cannot include a file above its own root. So the listing runs only for a sole selected default member whose manifest is the target’s own Cargo.toml. list_flags go after --allow-dirty, for a caller that must keep the listing from writing.

§Errors

Propagates the caller’s own failure to run cargo at all.