Struct build_env::BuildEnv
[−]
[src]
pub struct BuildEnv { /* fields omitted */ }
Allow retrieval of values pretaining to a build
process that may be related to the target
and/or host
triple.
Methods
impl BuildEnv
[src]
fn from_env() -> Result<BuildEnv, VarError>
Use environment variables (such as those set by cargo) to determine values for target
and
host
via the environment variables TARGET
and HOST
.
fn new_cross(host: String, target: String) -> BuildEnv
Construct a BuildEnv where the host and target may be different.
fn new(trip: String) -> BuildEnv
Construct a BuildEnv where target and host are the same.
fn target(&self) -> &str
The target we're supplying values for
fn host(&self) -> &str
The host we're supplying values for
fn var<K: AsRef<OsStr>>(&self, var_base: K) -> Option<OsString>
Query the environment for a value, trying the most specific first, before querying more general variables.
<var>_<target>
- for example,CC_x86_64-unknown-linux-gnu
<var>_<target_with_underscores>
- for example,CC_x86_64_unknown_linux_gnu
<build-kind>_<var>
- for example,HOST_CC
orTARGET_CFLAGS
<var>
- a plainCC
,AR
as above.
fn var_str<K: AsRef<OsStr> + Debug + Any>(
&self,
var_base: K
) -> Result<String, VarError<K>>
&self,
var_base: K
) -> Result<String, VarError<K>>
The same as Self::var(), but converts the return to an OsString and provides a useful error message
Trait Implementations
impl Debug for BuildEnv
[src]
impl Clone for BuildEnv
[src]
fn clone(&self) -> BuildEnv
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more