pub struct WasmBuildEvidence { /* private fields */ }Expand description
Build and source identities retained through caller-owned measurement.
Callers must hold source custody throughout acquisition and consumption.
Freshness checks detect persistent changes, not edits reverted between checks.
Keep this owner alive through measurement, then call verify_current before
accepting results. No process deadline, recipe or report publication is added.
Implementations§
Source§impl WasmBuildEvidence
impl WasmBuildEvidence
Sourcepub fn acquire(
spec: WasmBuildSpec,
spawn: impl FnMut(&mut Command) -> Result<OwnedChild>,
) -> Result<Self>
pub fn acquire( spec: WasmBuildSpec, spawn: impl FnMut(&mut Command) -> Result<OwnedChild>, ) -> Result<Self>
Acquire one retained build and reject source changes during acquisition.
The caller selects child custody through spawn, as with the underlying
Wasm build. No signal handler, retry or elapsed-time deadline is added.
§Errors
Returns build/input errors as typed I/O sources, or a freshness refusal.
Sourcepub fn verify_current(&self) -> Result<()>
pub fn verify_current(&self) -> Result<()>
Refuse changed source or a build not matching the retained input identity.
§Errors
Returns input-observation errors or InvalidData for mismatched evidence.
Sourcepub fn export_artifact(
&self,
index: usize,
destination: &Path,
maximum_bytes: usize,
) -> Result<WasmArtifactReceipt>
pub fn export_artifact( &self, index: usize, destination: &Path, maximum_bytes: usize, ) -> Result<WasmArtifactReceipt>
Capture a selected artifact under a byte cap and return its provenance.
The caller owns the destination parent and custody against other writers.
Existing destinations follow CapturedArtifact::retain_to replacement
semantics. The destination must be outside this build’s exact cache entry.
Copies stream through bounded scratch; no full-Wasm allocation is needed.
Keep this owner alive and verify freshness after measurement as well.
§Errors
Returns invalid selection/path, freshness, capture, hash or retention errors. Failed retention preserves its typed recovery paths; existing evidence is unchanged on admission, capture, hash or freshness refusal.