[][src]Struct cargo_project::Project

pub struct Project { /* fields omitted */ }

Information about a Cargo project

Methods

impl Project[src]

pub fn query<P>(path: P) -> Result<Self, Error> where
    P: AsRef<Path>, 
[src]

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.

pub fn path(
    &self,
    artifact: Artifact,
    profile: Profile,
    target: Option<&str>,
    host: &str
) -> Result<PathBuf, Error>
[src]

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 or Release (--release)
  • target is the specified compilation target (--target)
  • host is the triple of host -- this is used as the compilation target when no target is specified and the project has no default build target

pub fn name(&self) -> &str[src]

Returns the name of the project (package.name)

pub fn target(&self) -> Option<&str>[src]

Returns the default compilation target

pub fn toml(&self) -> &Path[src]

Returns the path to the project's Cargo.toml

pub fn target_dir(&self) -> &Path[src]

Returns the target directory path

This is where build artifacts are placed

Auto Trait Implementations

impl Send for Project

impl Sync for Project

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.