Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 25 variants Encode(String), Decode(String), InvalidKey(String), Random, Invalid { what: &'static str, reason: String, }, WrongDomain { expected: Domain, found: Domain, }, Threshold { domain: Domain, found: usize, needed: usize, }, PinMismatch, RootVersion { current: u32, found: u32, }, RootOrg, Expired(Domain), WrongTarget { expected: String, found: String, }, Replay { last: u64, found: u64, }, Equivocation(u64), Revoked(String), KnownBad(String), FreshnessMismatch, FreshnessRequired, Downgrade { installed: String, offered: String, }, BaseMismatch(String), ClientVersion(String), NotDelegated(String), UnsupportedKind(&'static str), File { path: String, reason: String, }, Rule(String),
}
Expand description

Everything that can go wrong while building, signing or checking update metadata.

Variants§

§

Encode(String)

CBOR encoding failed.

§

Decode(String)

CBOR decoding failed or the input was malformed.

§

InvalidKey(String)

A key, signature or hash could not be parsed, or is weak.

§

Random

The OS random generator failed.

§

Invalid

A record is structurally invalid (empty ids, bad thresholds, bad paths, limits).

Fields

§what: &'static str

What was being validated.

§reason: String

Why it was refused.

§

WrongDomain

An envelope was signed for a different purpose.

Fields

§expected: Domain

The domain the caller asked for.

§found: Domain

The domain in the envelope.

§

Threshold

Too few distinct trusted keys signed.

Fields

§domain: Domain

The record kind.

§found: usize

Valid signatures from distinct trusted keys.

§needed: usize

The threshold.

§

PinMismatch

The root’s keys do not hash to the fingerprint compiled into the app.

§

RootVersion

A root update does not follow the trusted root.

Fields

§current: u32

The trusted root version.

§found: u32

The offered root version.

§

RootOrg

A root update names a different org.

§

Expired(Domain)

A record has expired (or is not valid yet).

§

WrongTarget

The record is for a different app or channel than the caller asked for.

Fields

§expected: String

app/channel the caller expects.

§found: String

app/channel in the record.

§

Replay

The sequence number is not above the last one seen (replay or rollback).

Fields

§last: u64

Last seq seen for this app and channel.

§found: u64

Offered seq.

§

Equivocation(u64)

Two different manifests claim the same seq.

§

Revoked(String)

The update is listed as revoked by a trusted freshness record.

§

KnownBad(String)

The update failed its boot-health check on this device before.

§

FreshnessMismatch

The freshness record names another manifest.

§

FreshnessRequired

The root trusts timestamp keys but no valid freshness record came with the manifest.

§

Downgrade

A lower version without a rollback record.

Fields

§installed: String

Installed version.

§offered: String

Offered version.

§

BaseMismatch(String)

The installed base release is not one the update applies to.

§

ClientVersion(String)

The running client version is outside the update’s range.

§

NotDelegated(String)

The release key is not delegated for this app or channel, or its delegation expired.

§

UnsupportedKind(&'static str)

This client does not accept the update kind.

§

File

A downloaded file failed its size or hash check.

Fields

§path: String

Path from the manifest.

§reason: String

What failed.

§

Rule(String)

A targeting rule is invalid.

Trait Implementations§

Source§

impl Clone for Error

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 Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Eq for Error

Source§

impl Error for Error

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for Error

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 Error

Auto Trait Implementations§

§

impl Forget for Error

§

impl Freeze for Error

§

impl Move for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

§

impl UnwindSafe for Error

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.