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.
Implementations
impl BuildEnv
[src]
impl BuildEnv
[src]pub fn from_env() -> Result<BuildEnv, VarError<String>>
[src]
pub fn from_env() -> Result<BuildEnv, VarError<String>>
[src]Use environment variables (such as those set by cargo) to determine values for target
and
host
via the environment variables TARGET
and HOST
.
pub fn new_cross(host: String, target: String) -> BuildEnv
[src]
pub fn new_cross(host: String, target: String) -> BuildEnv
[src]Construct a BuildEnv where the host and target may be different.
pub fn used_env_vars(&self) -> impl Iterator<Item = &OsString>
[src]
pub fn used_env_vars(&self) -> impl Iterator<Item = &OsString>
[src]Get the env vars that have been used by build-env queries so far
pub fn cargo_print_used_env_vars(&self)
[src]
pub fn cargo_print_used_env_vars(&self)
[src]Print the used environment variables in the form interpreted by cargo: cargo:rerun-if-env-changed=FOO
pub fn mark_used(&mut self, var: OsString)
[src]
pub fn var<K: AsRef<OsStr>>(&mut self, var_base: K) -> Option<OsString>
[src]
pub fn var<K: AsRef<OsStr>>(&mut self, var_base: K) -> Option<OsString>
[src]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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for BuildEnv
impl Send for BuildEnv
impl Sync for BuildEnv
impl Unpin for BuildEnv
impl UnwindSafe for BuildEnv
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more