pub struct BuildOutput {
    pub library_paths: Vec<PathBuf>,
    pub library_links: Vec<String>,
    pub linker_args: Vec<(LinkArgTarget, String)>,
    pub cfgs: Vec<String>,
    pub check_cfgs: Vec<String>,
    pub env: Vec<(String, String)>,
    pub metadata: Vec<(String, String)>,
    pub rerun_if_changed: Vec<PathBuf>,
    pub rerun_if_env_changed: Vec<String>,
    pub warnings: Vec<String>,
}
Expand description

Contains the parsed output of a custom build script.

Fields§

§library_paths: Vec<PathBuf>

Paths to pass to rustc with the -L flag.

§library_links: Vec<String>

Names and link kinds of libraries, suitable for the -l flag.

§linker_args: Vec<(LinkArgTarget, String)>

Linker arguments suitable to be passed to -C link-arg=<args>

§cfgs: Vec<String>

Various --cfg flags to pass to the compiler.

§check_cfgs: Vec<String>

Various --check-cfg flags to pass to the compiler.

§env: Vec<(String, String)>

Additional environment variables to run the compiler with.

§metadata: Vec<(String, String)>

Metadata to pass to the immediate dependencies.

§rerun_if_changed: Vec<PathBuf>

Paths to trigger a rerun of this build script. May be absolute or relative paths (relative to package root).

§rerun_if_env_changed: Vec<String>

Environment variables which, when changed, will cause a rebuild.

§warnings: Vec<String>

Warnings generated by this build.

These are only displayed if this is a “local” package, -vv is used, or there is a build error for any target in this package.

Implementations§

source§

impl BuildOutput

source

pub fn parse_file( path: &Path, library_name: Option<String>, pkg_descr: &str, script_out_dir_when_generated: &Path, script_out_dir: &Path, extra_check_cfg: bool, nightly_features_allowed: bool, targets: &[Target] ) -> CargoResult<BuildOutput>

Like BuildOutput::parse but from a file path.

source

pub fn parse( input: &[u8], library_name: Option<String>, pkg_descr: &str, script_out_dir_when_generated: &Path, script_out_dir: &Path, extra_check_cfg: bool, nightly_features_allowed: bool, targets: &[Target] ) -> CargoResult<BuildOutput>

Parses the output instructions of a build script.

  • pkg_descr — for error messages
  • library_name — for determining if RUSTC_BOOTSTRAP should be allowed
  • extra_check_cfg — for unstable feature -Zcheck-cfg
source

pub fn parse_rustc_flags( value: &str, whence: &str ) -> CargoResult<(Vec<PathBuf>, Vec<String>)>

Parses cargo:rustc-flags instruction.

source

pub fn parse_rustc_env( value: &str, whence: &str ) -> CargoResult<(String, String)>

Parses cargo:rustc-env instruction.

Trait Implementations§

source§

impl Clone for BuildOutput

source§

fn clone(&self) -> BuildOutput

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BuildOutput

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for BuildOutput

source§

fn default() -> BuildOutput

Returns the “default value” for a type. Read more
source§

impl Hash for BuildOutput

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 240 bytes