pub struct Env {Show 22 fields
pub cargo: PathBuf,
pub cargo_manifest_dir: PathBuf,
pub cargo_manifest_links: Option<OsString>,
pub cargo_cfg_unix: bool,
pub cargo_cfg_windows: bool,
pub cargo_cfg_target_family: String,
pub cargo_cfg_target_os: String,
pub cargo_cfg_target_arch: String,
pub cargo_cfg_target_vendor: String,
pub cargo_cfg_target_env: String,
pub cargo_cfg_target_pointer_width: String,
pub cargo_cfg_target_endian: String,
pub cargo_cfg_target_features: BTreeSet<String>,
pub out_dir: PathBuf,
pub target: String,
pub host: String,
pub num_jobs: String,
pub opt_level: String,
pub profile: String,
pub rustc: PathBuf,
pub rustdoc: Option<PathBuf>,
pub rustc_linker: Option<PathBuf>,
}
Expand description
Fields
cargo: PathBuf
Path to the cargo
binary performing the build.
cargo_manifest_dir: PathBuf
The directory containing the manifest for the package being built (the package containing the build script). Also note that this is the value of the current working directory of the build script when it starts.
cargo_manifest_links: Option<OsString>
The manifest links
value.
cargo_cfg_unix: bool
Set on unix-like platforms.
cargo_cfg_windows: bool
Set on windows-like platforms.
cargo_cfg_target_family: String
The target family (windows, unix)
cargo_cfg_target_os: String
The target operating system (windows, macos, ios, linux, android, freebsd, dragonfly, openbsd, netbsd, …)
cargo_cfg_target_arch: String
The CPU target architecture (x86, x86_64, mips, powerpc, powerpc64, arm, aarch64, …)
cargo_cfg_target_vendor: String
The target vendor (apple, fortanix, pc, unknown, …)
cargo_cfg_target_env: String
The target environment ABI (blank, gnu, msvc, musl, sgx, …)
cargo_cfg_target_pointer_width: String
The CPU pointer width (16, 32, 64, …)
cargo_cfg_target_endian: String
The CPU target endianness (little, big, …)
cargo_cfg_target_features: BTreeSet<String>
List of CPU target features enabled (avx, avx2, crt-static, rdrand, sse, sse2, sse4.1, …)
out_dir: PathBuf
The folder in which all output should be placed
target: String
The target triple that is being compiled for (x86_64-pc-windows-msvc, …)
host: String
The host triple of the rust compiler / build scripts (x86_64-pc-windows-msvc, …)
num_jobs: String
The parallelism specified as the top-level parallelism.
opt_level: String
Values of the corresponding variables for the profile currently being built (DEBUG, …)
profile: String
release
for release builds, debug
for debug builds, custom profiles may add more values
rustc: PathBuf
The compiler cargo has resolved to use
rustdoc: Option<PathBuf>
The documentation generator cargo has resolved to use
rustc_linker: Option<PathBuf>
The linker binary that Cargo has resolved to use for the current target, if specified
Implementations
sourceimpl Env
impl Env
sourcepub fn cargo_feature(&self, name: impl AsRef<str>) -> bool
pub fn cargo_feature(&self, name: impl AsRef<str>) -> bool
Is the given feature activated for the package being built?
pub fn cargo_cfg(&self, name: impl AsRef<str>) -> bool
pub fn cargo_cfg_str(&self, name: impl AsRef<str>) -> Option<String>
pub fn cargo_cfg_vec_str(&self, name: impl AsRef<str>) -> Vec<String>
pub fn dep(&self, name: impl AsRef<str>, key: impl AsRef<str>) -> Option<String>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Env
impl Send for Env
impl Sync for Env
impl Unpin for Env
impl UnwindSafe for Env
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more