pub struct BuildEnvironment {
pub variables: BTreeMap<OsString, OsString>,
pub features: BitFlags<BuildFeature>,
pub cuda_library_dirs: Vec<PathBuf>,
}Expand description
Everything the native build reads from outside: the environment variables, the cargo features this crate was compiled with, and the CUDA library directories installed on the host.
Fields§
§variables: BTreeMap<OsString, OsString>§features: BitFlags<BuildFeature>§cuda_library_dirs: Vec<PathBuf>Implementations§
Source§impl BuildEnvironment
impl BuildEnvironment
Sourcepub fn of_process() -> Self
pub fn of_process() -> Self
The environment of the running build script.
Sourcepub fn var(&self, name: &'static str) -> Result<String, VarError>
pub fn var(&self, name: &'static str) -> Result<String, VarError>
§Errors
Returns VarError::NotPresent for a variable the environment lacks, or
VarError::NotUnicode for one that is not Unicode.
Sourcepub fn required(&self, name: &'static str) -> Result<String, BuildError>
pub fn required(&self, name: &'static str) -> Result<String, BuildError>
§Errors
Returns BuildError::Environment when the variable is missing or not Unicode.
Sourcepub fn optional(&self, name: &'static str) -> Result<Option<String>, BuildError>
pub fn optional(&self, name: &'static str) -> Result<Option<String>, BuildError>
§Errors
Returns BuildError::Environment when the variable is set but not Unicode.
pub fn has(&self, feature: BuildFeature) -> bool
Trait Implementations§
Source§impl Clone for BuildEnvironment
impl Clone for BuildEnvironment
Source§impl Debug for BuildEnvironment
impl Debug for BuildEnvironment
impl Eq for BuildEnvironment
Source§impl PartialEq for BuildEnvironment
impl PartialEq for BuildEnvironment
impl StructuralPartialEq for BuildEnvironment
Auto Trait Implementations§
impl Freeze for BuildEnvironment
impl RefUnwindSafe for BuildEnvironment
impl Send for BuildEnvironment
impl Sync for BuildEnvironment
impl Unpin for BuildEnvironment
impl UnsafeUnpin for BuildEnvironment
impl UnwindSafe for BuildEnvironment
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more