pub struct WasmBuildSession<'guard> { /* private fields */ }Expand description
Explicit cross-call input snapshot scoped to a caller-held source lease.
The session contains no global state. It may reuse successful Cargo/rustc identity, metadata, input-discovery, and content-digest work while the caller keeps the supplied write-exclusion guard alive and unchanged.
Implementations§
Source§impl<'guard> WasmBuildSession<'guard>
impl<'guard> WasmBuildSession<'guard>
Sourcepub fn assume_sources_immutable<Guard: ?Sized>(
_source_write_guard: &'guard Guard,
) -> Self
pub fn assume_sources_immutable<Guard: ?Sized>( _source_write_guard: &'guard Guard, ) -> Self
Assert source immutability and bind reuse to the supplied guard’s lifetime.
The guard must prevent mutation of every Cargo/rustc executable, manifest, configuration file, discovered source, declared additional input, and relevant environment value used by every specification sent through this session. The guard must remain held until the session is dropped. This method cannot verify the guard’s provenance; supplying an unrelated value can permit stale cache reuse.
Sourcepub fn build_batch(
&mut self,
specs: &[LabeledWasmBuildSpec],
config: WasmBuildBatchConfig,
) -> Result<WasmBuildBatchReport, WasmBuildBatchContractError>
pub fn build_batch( &mut self, specs: &[LabeledWasmBuildSpec], config: WasmBuildBatchConfig, ) -> Result<WasmBuildBatchReport, WasmBuildBatchContractError>
Build one sequential collect-all batch using retained immutable inputs.
Sourcepub fn build_batch_with_progress<F>(
&mut self,
specs: &[LabeledWasmBuildSpec],
batch_config: WasmBuildBatchConfig,
progress_config: WasmBuildProgressConfig,
observer: F,
) -> Result<WasmBuildBatchReport, WasmBuildBatchContractError>where
F: FnMut(WasmBuildBatchProgressEvent),
pub fn build_batch_with_progress<F>(
&mut self,
specs: &[LabeledWasmBuildSpec],
batch_config: WasmBuildBatchConfig,
progress_config: WasmBuildProgressConfig,
observer: F,
) -> Result<WasmBuildBatchReport, WasmBuildBatchContractError>where
F: FnMut(WasmBuildBatchProgressEvent),
Build one observed sequential batch using retained immutable inputs.
Sourcepub const fn metrics(&self) -> WasmBuildSessionMetrics
pub const fn metrics(&self) -> WasmBuildSessionMetrics
Current retained snapshot, reuse, and invalidation counters.