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 log_messages: Vec<(Severity, 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.
log_messages: Vec<(Severity, String)>
Errors and 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. Note that any log
message of severity Error
will by itself cause a build error, and will
cause all log messages to be displayed.
Implementations§
Source§impl BuildOutput
impl BuildOutput
Sourcepub fn parse_file(
path: &Path,
library_name: Option<String>,
pkg_descr: &str,
script_out_dir_when_generated: &Path,
script_out_dir: &Path,
nightly_features_allowed: bool,
targets: &[Target],
msrv: &Option<RustVersion>,
) -> CargoResult<BuildOutput>
pub fn parse_file( path: &Path, library_name: Option<String>, pkg_descr: &str, script_out_dir_when_generated: &Path, script_out_dir: &Path, nightly_features_allowed: bool, targets: &[Target], msrv: &Option<RustVersion>, ) -> CargoResult<BuildOutput>
Like BuildOutput::parse
but from a file path.
Sourcepub fn parse(
input: &[u8],
library_name: Option<String>,
pkg_descr: &str,
script_out_dir_when_generated: &Path,
script_out_dir: &Path,
nightly_features_allowed: bool,
targets: &[Target],
msrv: &Option<RustVersion>,
) -> CargoResult<BuildOutput>
pub fn parse( input: &[u8], library_name: Option<String>, pkg_descr: &str, script_out_dir_when_generated: &Path, script_out_dir: &Path, nightly_features_allowed: bool, targets: &[Target], msrv: &Option<RustVersion>, ) -> CargoResult<BuildOutput>
Parses the output instructions of a build script.
pkg_descr
— for error messageslibrary_name
— for determining ifRUSTC_BOOTSTRAP
should be allowed
Sourcepub fn parse_rustc_flags(
value: &str,
whence: &str,
) -> CargoResult<(Vec<PathBuf>, Vec<String>)>
pub fn parse_rustc_flags( value: &str, whence: &str, ) -> CargoResult<(Vec<PathBuf>, Vec<String>)>
Parses cargo::rustc-flags
instruction.
Sourcepub fn parse_rustc_env(
value: &str,
whence: &str,
) -> CargoResult<(String, String)>
pub fn parse_rustc_env( value: &str, whence: &str, ) -> CargoResult<(String, String)>
Parses cargo::rustc-env
instruction.
Trait Implementations§
Source§impl Clone for BuildOutput
impl Clone for BuildOutput
Source§fn clone(&self) -> BuildOutput
fn clone(&self) -> BuildOutput
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for BuildOutput
impl Debug for BuildOutput
Source§impl Default for BuildOutput
impl Default for BuildOutput
Source§fn default() -> BuildOutput
fn default() -> BuildOutput
Source§impl Hash for BuildOutput
impl Hash for BuildOutput
Source§impl Ord for BuildOutput
impl Ord for BuildOutput
Source§fn cmp(&self, other: &BuildOutput) -> Ordering
fn cmp(&self, other: &BuildOutput) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for BuildOutput
impl PartialEq for BuildOutput
Source§impl PartialOrd for BuildOutput
impl PartialOrd for BuildOutput
impl Eq for BuildOutput
impl StructuralPartialEq for BuildOutput
Auto Trait Implementations§
impl Freeze for BuildOutput
impl RefUnwindSafe for BuildOutput
impl Send for BuildOutput
impl Sync for BuildOutput
impl Unpin for BuildOutput
impl UnwindSafe for BuildOutput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
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