Struct cargo_project::Project
source · pub struct Project { /* private fields */ }Expand description
Information about a Cargo project
Implementations§
source§impl Project
impl Project
sourcepub fn query<P>(path: P) -> Result<Self, Error>where
P: AsRef<Path>,
pub fn query<P>(path: P) -> Result<Self, Error>where
P: AsRef<Path>,
Retrieves information about the Cargo project at the given path
path doesn’t need to be the directory that contains the Cargo.toml file; it can be any
point within the Cargo project.
sourcepub fn path(
&self,
artifact: Artifact<'_>,
profile: Profile,
target: Option<&str>,
host: &str
) -> Result<PathBuf, Error>
pub fn path(
&self,
artifact: Artifact<'_>,
profile: Profile,
target: Option<&str>,
host: &str
) -> Result<PathBuf, Error>
Returns the path to a build artifact
Inputs
artifactis the kind of build artifact:Bin(--bin),Example(--example),Lib(--lib)profileis the compilation profile:DevorRelease(--release)targetis the specified compilation target (--target)hostis the triple of host – this is used as the compilation target when notargetis specified and the project has no default build target
sourcepub fn target_dir(&self) -> &Path
pub fn target_dir(&self) -> &Path
Returns the target directory path
This is where build artifacts are placed