Skip to main content

ConformanceVector

Struct ConformanceVector 

Source
pub struct ConformanceVector {
    pub admitted: Vec<LawAxis>,
    pub refused: Vec<LawAxis>,
    pub unknown: Vec<LawAxis>,
    pub score: Option<f64>,
    pub strict_mode: bool,
    pub process_quality: Option<ConformanceResult>,
    pub admitted_bits: u64,
    pub refused_bits: u64,
    pub unknown_bits: u64,
}
Expand description

Three-valued conformance state: Admitted / Refused / Unknown are distinct sets, and Unknown never collapses into either (doing so is a defect). See the runnable explanation and contract witness in examples/conformance_vector_explained.rs, which asserts this law and panics if it regresses. For the gate composing with receipt verification, see examples/admission_pipeline.rs.

Fields§

§admitted: Vec<LawAxis>

Law axes that have been admitted (evidence present and valid)

§refused: Vec<LawAxis>

Law axes that have been explicitly refused (evidence present, violation confirmed)

§unknown: Vec<LawAxis>

Law axes where admissibility cannot be determined (NEVER collapsed into admitted or refused)

§score: Option<f64>

Derived score: 100 * admitted / (admitted + refused + unknown), None if all unknown

§strict_mode: bool

Whether unknown axes block release actuation

§process_quality: Option<ConformanceResult>

Process quality from POWL conformance check. None until wasm4pm graduation.

§admitted_bits: u64

Bitmask for admitted axes (bits 0–10 = Protocol..Domain). Not serialized.

§refused_bits: u64

Bitmask for refused axes. Not serialized.

§unknown_bits: u64

Bitmask for unknown axes. Not serialized.

Implementations§

Source§

impl ConformanceVector

Source

pub fn all_admitted(&self) -> bool

Source

pub fn admits_release(&self) -> bool

Source

pub fn sync_bits_from_vecs(&mut self)

Recompute all three bitmasks from the Vec fields.

Call this after constructing from a struct literal or deserializing from JSON, so the internal index stays consistent.

Source

pub fn set_admitted(&mut self, id: LawAxisId)

Mark an axis as admitted, removing it from refused and unknown sets.

Source

pub fn set_refused(&mut self, id: LawAxisId)

Mark an axis as refused, removing it from admitted and unknown sets.

Source

pub fn set_unknown(&mut self, id: LawAxisId)

Mark an axis as unknown, removing it from admitted and refused sets.

Source

pub fn is_admitted_bit(&self, id: LawAxisId) -> bool

Source

pub fn is_refused_bit(&self, id: LawAxisId) -> bool

Source

pub fn is_unknown_bit(&self, id: LawAxisId) -> bool

Source

pub fn assert_bitmask_invariants(&self)

Assert all three bitmasks are mutually disjoint.

Trait Implementations§

Source§

impl Clone for ConformanceVector

Source§

fn clone(&self) -> ConformanceVector

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 ConformanceVector

Source§

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

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

impl Default for ConformanceVector

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for ConformanceVector

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ConformanceVector

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> EvidenceKind for T

Source§

default fn kind_label(&self) -> &'static str

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.