Skip to main content

ProvenSafeIngest

Struct ProvenSafeIngest 

Source
pub struct ProvenSafeIngest {
    pub accepted: bool,
    pub refusal: Option<String>,
    pub scry_version: String,
    pub declared_module_sha256: String,
    pub actual_module_sha256: String,
    pub declared_memory_min_bytes: u64,
    pub offered: Vec<SafeSite>,
    pub diagnostics: Vec<String>,
}
Expand description

The result of ingesting a safe-accesses.json. TOTAL by design — there is deliberately no Result in ingest’s return type, mirroring crate::wsc_facts::parse_wsc_facts: no input may turn a successful compile into a failed one.

When ProvenSafeIngest::accepted is false, ProvenSafeIngest::offered is EMPTY — a refused document is not trusted piecemeal — and ProvenSafeIngest::refusal names why.

Fields§

§accepted: bool

Did the document clear every whole-file gate (schema, hash, memory floor)? False ⇒ elide nothing.

§refusal: Option<String>

Some(reason) exactly when accepted is false.

§scry_version: String

The producer version string, for the attestation. Empty if absent or the document was unreadable.

§declared_module_sha256: String

The module_sha256 the document declared (hex, as written). Empty when the document did not parse.

§actual_module_sha256: String

The sha256 synth computed over the module it is actually compiling.

§declared_memory_min_bytes: u64

The memory_min_bytes the document declared.

§offered: Vec<SafeSite>

Sites the document offered, once the whole-file gates passed. These are candidates: each still faces ProvenSafeIngest::validate_function.

§diagnostics: Vec<String>

Human-facing diagnostics (warnings). Never an error.

Implementations§

Source§

impl ProvenSafeIngest

Source

pub fn offered_for_func(&self, func: u32) -> Vec<&SafeSite>

Sites this document offered for one function, in pc order.

Source

pub fn validate_function( &self, func: u32, ops: &[WasmOp], notes: &mut Vec<String>, ) -> Vec<usize>

The self-checking key. Validate this function’s offered sites against the operator stream synth actually decoded, and return the operator indices that survive — the per-site elision marks.

An entry is DROPPED (with a diagnostic pushed into notes) when:

  • pc is out of range for this function’s op count;
  • the op at pc is not a linear-memory access;
  • the op’s access width differs from the declared width.

Dropping rather than refusing the whole file is deliberate and matches the wsc.facts per-record rule: a newer scry proving an access class synth does not guard must not invalidate the sites it does guard. The safety direction is preserved either way — a dropped entry keeps its guard.

Trait Implementations§

Source§

impl Clone for ProvenSafeIngest

Source§

fn clone(&self) -> ProvenSafeIngest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProvenSafeIngest

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for ProvenSafeIngest

Source§

fn default() -> ProvenSafeIngest

Returns the “default value” for a type. Read more
Source§

impl Eq for ProvenSafeIngest

Source§

impl PartialEq for ProvenSafeIngest

Source§

fn eq(&self, other: &ProvenSafeIngest) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ProvenSafeIngest

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.