pub struct WasmBuildSpec { /* private fields */ }Expand description
Complete caller-owned description of one cacheable Cargo Wasm build.
The package dependency closure, workspace manifest, lockfile, Cargo configuration, Rust toolchain files, target, profile arguments, explicit child environment, selected inherited environment, and additional watched inputs all contribute to the build fingerprint.
Implementations§
Source§impl WasmBuildSpec
impl WasmBuildSpec
Sourcepub fn new(
workspace_root: &Path,
target_dir: &Path,
packages: &[&str],
profile_target_dir: &str,
) -> Self
pub fn new( workspace_root: &Path, target_dir: &Path, packages: &[&str], profile_target_dir: &str, ) -> Self
Describe one Cargo build targeting wasm32-unknown-unknown.
profile_target_dir is Cargo’s output subdirectory, such as debug,
release, or the name supplied to --profile.
Sourcepub fn with_cargo_profile_args(self, arguments: &[&str]) -> Self
pub fn with_cargo_profile_args(self, arguments: &[&str]) -> Self
Set Cargo profile and feature arguments used for both the build and fingerprint.
Sourcepub fn with_extra_env(self, environment: &[(&str, &str)]) -> Self
pub fn with_extra_env(self, environment: &[(&str, &str)]) -> Self
Set deterministic child-process environment overrides.
Sourcepub fn with_inherited_env(self, names: &[&str]) -> Self
pub fn with_inherited_env(self, names: &[&str]) -> Self
Add ambient environment variables whose current values affect the build.
Common Rust and Cargo toolchain variables are included automatically. Callers must declare application-specific variables read by build scripts.
Sourcepub fn with_additional_inputs(self, paths: &[&str]) -> Self
pub fn with_additional_inputs(self, paths: &[&str]) -> Self
Add files or directories not discoverable through Cargo’s local dependency graph.
Relative paths are resolved from the workspace root. Use this for build script configuration, generated schemas, or other externally read inputs.
Sourcepub fn with_target(self, target: &str) -> Self
pub fn with_target(self, target: &str) -> Self
Override the Cargo compilation target.
Sourcepub fn with_cargo_program(self, program: impl Into<OsString>) -> Self
pub fn with_cargo_program(self, program: impl Into<OsString>) -> Self
Override the Cargo executable used by metadata, identity, and build commands.
Sourcepub fn with_rustc_program(self, program: impl Into<OsString>) -> Self
pub fn with_rustc_program(self, program: impl Into<OsString>) -> Self
Override the Rust compiler executable used to fingerprint the toolchain.
Sourcepub fn workspace_root(&self) -> &Path
pub fn workspace_root(&self) -> &Path
Workspace containing the selected Cargo packages.
Sourcepub fn target_dir(&self) -> &Path
pub fn target_dir(&self) -> &Path
Cargo target directory containing artifacts, lock, and stamps.
Trait Implementations§
Source§impl Clone for WasmBuildSpec
impl Clone for WasmBuildSpec
Source§fn clone(&self) -> WasmBuildSpec
fn clone(&self) -> WasmBuildSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WasmBuildSpec
impl Debug for WasmBuildSpec
impl Eq for WasmBuildSpec
Source§impl PartialEq for WasmBuildSpec
impl PartialEq for WasmBuildSpec
impl StructuralPartialEq for WasmBuildSpec
Auto Trait Implementations§
impl Freeze for WasmBuildSpec
impl RefUnwindSafe for WasmBuildSpec
impl Send for WasmBuildSpec
impl Sync for WasmBuildSpec
impl Unpin for WasmBuildSpec
impl UnsafeUnpin for WasmBuildSpec
impl UnwindSafe for WasmBuildSpec
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.