Skip to main content

OracleMode

Enum OracleMode 

Source
pub enum OracleMode {
    NotRun,
    ReferenceZic,
    ReferenceZdump,
    StructuralDecode,
    Unavailable(String),
}
Expand description

Which oracle backed a report’s verdicts (T15.2 — CONTRACT.TYPING). The single owner type for the oracle-mode vocabulary: as of T15.2a, OracleResult::mode is this enum too (no claim-bearing path emits the vocabulary as a free string). Reports render mode_str (canonical snake_case); the zic-rs-compile-manifest-v8 oracle.mode field renders manifest_str, a boundary-only compatibility shim that preserves the one legacy value ("not-run") the manifest has ever emitted — removal plan: canonicalize to mode_str at the next manifest major bump (a drift test pins that the shim diverges for that one value only). The rule it enforces: oracle absence is visible — a report renders Unavailable(reason) (→ skipped_with_reason), never silence, so a verdict can never silently weaken when reference tools are missing.

Variants§

§

NotRun

No oracle was consulted by design (e.g. support-report is compile-coverage, not behaviour).

§

ReferenceZic

Reference zic’s emitted bytes were the oracle (e.g. structural-report).

§

ReferenceZdump

Reference zdump’s decoded behaviour was the oracle (the compare zdump mode).

§

StructuralDecode

A decoded-TZif structural comparison (the compare structural mode).

§

Unavailable(String)

The required oracle tool was unavailable; the verdict was skipped, with this reason.

Implementations§

Source§

impl OracleMode

Source

pub fn mode_str(&self) -> &'static str

The stable snake_case discriminant.

Source

pub fn skipped_with_reason(&self) -> Option<&str>

The reason an oracle was skipped, when (and only when) it was Unavailable.

Source

pub fn manifest_str(&self) -> &'static str

The zic-rs-compile-manifest-v8 boundary rendering (T15.2a compatibility shim). The manifest path only ever holds NotRun and has historically emitted "not-run" (hyphenated); that one value is preserved here for back-compat. Every other variant has no legacy manifest form (they never appeared there), so this is identical to mode_str for them — i.e. the shim diverges for exactly one value, which a drift test pins. Removal plan: canonicalize to mode_str at the next manifest major bump.

Source

pub fn to_json_field(&self) -> String

Render as the report’s oracle_mode object: { "mode": …, "skipped_with_reason": …|null }. Absence is always visible — skipped_with_reason is non-null exactly when the oracle was missing.

Trait Implementations§

Source§

impl Clone for OracleMode

Source§

fn clone(&self) -> OracleMode

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 OracleMode

Source§

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

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

impl Eq for OracleMode

Source§

impl PartialEq for OracleMode

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 StructuralPartialEq for OracleMode

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.