Skip to main content

ProofPolicy

Struct ProofPolicy 

Source
#[repr(C)]
pub struct ProofPolicy { pub required_tier: ProofTier, pub max_verification_time_us: u32, pub max_validity_window_ns: u64, pub require_coherence_cert: bool, pub min_coherence_in_proof: u16, }
Expand description

Policy for proof verification on a store.

Fields§

§required_tier: ProofTier

Required proof tier for mutations.

§max_verification_time_us: u32

Maximum allowed verification time in microseconds. Proofs exceeding this are rejected.

§max_validity_window_ns: u64

Maximum proof validity window in nanoseconds. Proofs with longer validity are rejected.

§require_coherence_cert: bool

Whether to require coherence certificates for Deep tier.

§min_coherence_in_proof: u16

Minimum coherence score in proof (for CoherenceCert payloads).

Implementations§

Source§

impl ProofPolicy

Source

pub const fn reflex() -> Self

Creates a Reflex-tier policy (sub-microsecond hash checks).

Source

pub const fn standard() -> Self

Creates a Standard-tier policy (Merkle witness verification).

Source

pub const fn deep() -> Self

Creates a Deep-tier policy (full coherence verification).

Source

pub const fn with_tier(self, tier: ProofTier) -> Self

Sets the required proof tier.

Source

pub const fn with_max_verification_time_us(self, time_us: u32) -> Self

Sets the maximum verification time.

Source

pub const fn with_max_validity_ns(self, validity_ns: u64) -> Self

Sets the maximum validity window.

Source

pub const fn tier_satisfies(&self, proof_tier: ProofTier) -> bool

Checks if a proof tier satisfies this policy.

Trait Implementations§

Source§

impl Clone for ProofPolicy

Source§

fn clone(&self) -> ProofPolicy

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ProofPolicy

Source§

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

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

impl Default for ProofPolicy

Source§

fn default() -> Self

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

impl PartialEq for ProofPolicy

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for ProofPolicy

Source§

impl Eq for ProofPolicy

Source§

impl StructuralPartialEq for ProofPolicy

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<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> 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.