Skip to main content

VerifyResult

Struct VerifyResult 

Source
pub struct VerifyResult {
    pub ok: bool,
    pub code: Option<ErrorCode>,
    pub level: Option<Level>,
    pub hash: Option<String>,
    pub computed_by: Option<String>,
    pub blob_checked: bool,
    pub detail: String,
    pub path: String,
}
Expand description

The outcome of verify.

code is None when ok, with one exception: ErrorCode::EvalUnavailable, the one code of SPEC 10.2 that is not a failure (10.1 step 7.6). When a resolver is given and 7.1-7.5 pass but Resolver::evaluate returns None, the receipt is still signature-valid, so the result is ok, level Level::Signed, with code: Some(EvalUnavailable), path $.value and a detail: recomputation did not happen, and the code says why. Step 7.7 still runs afterwards: if it passes, blob_checked is true and the code is kept; if it fails, its failure replaces the code as a normal failure (ok false, its own code).

Fields§

§ok: bool

Whether the receipt verified.

§code: Option<ErrorCode>

The failure’s code; None when ok, except ErrorCode::EvalUnavailable.

§level: Option<Level>

The level reached; None unless ok.

§hash: Option<String>

The receipt hash, once the receipt was canonical enough to compute it.

§computed_by: Option<String>

The receipt’s computed_by (<host>#<key id>), once steps 1-4 passed.

§blob_checked: bool

Whether step 7.7 ran and passed.

§detail: String

A human explanation of the failure (or of EvalUnavailable); empty otherwise.

§path: String

Where the failure (or EvalUnavailable) was found; empty otherwise.

Implementations§

Source§

impl VerifyResult

Source

pub fn error(&self) -> Option<Error>

code as an Error, with path and detail: the failure, or EvalUnavailable.

Trait Implementations§

Source§

impl Clone for VerifyResult

Source§

fn clone(&self) -> Self

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 VerifyResult

Source§

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

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

impl Eq for VerifyResult

Source§

impl PartialEq for VerifyResult

Source§

fn eq(&self, other: &Self) -> 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 VerifyResult

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> 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 = !

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.