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
artifact
is the kind of build artifact:Bin
(--bin
),Example
(--example
),Lib
(--lib
)profile
is the compilation profile:Dev
orRelease
(--release
)target
is the specified compilation target (--target
)host
is the triple of host – this is used as the compilation target when notarget
is 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