Skip to main content

WasmBuildEvidence

Struct WasmBuildEvidence 

Source
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

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Debug for WasmBuildEvidence

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.