Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error {
Show 27 variants BadSignature(MetadataPath), Encoding(String), ExpiredMetadata { path: MetadataPath, expiration: DateTime<Utc>, now: DateTime<Utc>, }, IllegalArgument(String), Http { uri: String, err: Error, }, Hyper { uri: String, err: Error, }, BadHttpStatus { uri: String, code: StatusCode, }, Io(Error), IoPath { path: PathBuf, err: Error, }, Json(Error), NoSupportedHashAlgorithm, MetadataNotFound { path: MetadataPath, version: MetadataVersion, }, TargetNotFound(TargetPath), Opaque(String), UnknownKeyType(String), UnknownSignatureScheme(String), MetadataVersionMustBeGreaterThanZero(MetadataPath), MetadataVersionMustBeSmallerThanMaxU32(MetadataPath), MetadataThresholdMustBeGreaterThanZero(MetadataPath), MetadataRoleHasDuplicateKeyId { role: MetadataPath, key_id: KeyId, }, MetadataRoleDoesNotHaveEnoughKeyIds { role: MetadataPath, key_ids: usize, threshold: u32, }, MetadataMissingSignatures { role: MetadataPath, number_of_valid_signatures: u32, threshold: u32, }, AttemptedMetadataRollBack { role: MetadataPath, trusted_version: u32, new_version: u32, }, WrongMetadataVersion { parent_role: MetadataPath, child_role: MetadataPath, expected_version: u32, new_version: u32, }, MissingMetadataDescription { parent_role: MetadataPath, child_role: MetadataPath, }, UnauthorizedDelegation { parent_role: MetadataPath, child_role: MetadataPath, }, MissingPrivateKey { role: MetadataPath, },
}
Expand description

Error type for all TUF related errors.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

BadSignature(MetadataPath)

The metadata had a bad signature.

§

Encoding(String)

There was a problem encoding or decoding.

§

ExpiredMetadata

Metadata was expired.

Fields

§path: MetadataPath

The metadata that expired.

§expiration: DateTime<Utc>

When the metadata expired.

§now: DateTime<Utc>

The latest known time.

§

IllegalArgument(String)

An illegal argument was passed into a function.

§

Http

Generic error for HTTP connections.

Fields

§uri: String

URI Resource that resulted in the error.

§err: Error

The error.

§

Hyper

Errors that can occur parsing HTTP streams.

Fields

§uri: String

URI Resource that resulted in the error.

§err: Error

The error.

§

BadHttpStatus

Unexpected HTTP response status.

Fields

§uri: String

URI Resource that resulted in the error.

§code: StatusCode

HTTP status code.

§

Io(Error)

An IO error occurred.

§

IoPath

An IO error occurred for a path.

Fields

§path: PathBuf

Path where the error occurred.

§err: Error

The IO error.

§

Json(Error)

A json serialization error occurred.

§

NoSupportedHashAlgorithm

There were no available hash algorithms.

§

MetadataNotFound

The metadata was not found.

Fields

§path: MetadataPath

The metadata path.

§version: MetadataVersion

The metadata version.

§

TargetNotFound(TargetPath)

The target was not found.

§

Opaque(String)

Opaque error type, to be interpreted similar to HTTP 500. Something went wrong, and you may or may not be able to do anything about it.

§

UnknownKeyType(String)

There is no known or available key type.

§

UnknownSignatureScheme(String)

There is no known or available signature scheme.

§

MetadataVersionMustBeGreaterThanZero(MetadataPath)

The metadata’s version must be greater than 0.

§

MetadataVersionMustBeSmallerThanMaxU32(MetadataPath)

The metadata’s version must be less than u32::MAX.

§

MetadataThresholdMustBeGreaterThanZero(MetadataPath)

The metadata threshold must be greater than 0.

§

MetadataRoleHasDuplicateKeyId

The metadata role has a duplicate keyid.

Fields

§role: MetadataPath

The metadata.

§key_id: KeyId

The duplicated keyid.

§

MetadataRoleDoesNotHaveEnoughKeyIds

The metadata role does not have enough keyids.

Fields

§role: MetadataPath

The metadata.

§key_ids: usize

The number of keyids.

§threshold: u32

The minimum threshold of keys.

§

MetadataMissingSignatures

The metadata was not signed with enough valid signatures.

Fields

§role: MetadataPath

The signed metadata.

§number_of_valid_signatures: u32

The number of signatures which are valid.

§threshold: u32

The minimum number of valid signatures.

§

AttemptedMetadataRollBack

Attempted to update metadata with an older version.

Fields

§role: MetadataPath

The metadata.

§trusted_version: u32

The trusted metadata’s version.

§new_version: u32

The new metadata’s version.

§

WrongMetadataVersion

The parent metadata expected the child metadata to be at one version, but was found to be at another version.

Fields

§parent_role: MetadataPath

The parent metadata that contains the child metadata’s version.

§child_role: MetadataPath

The child metadata that has an unexpected version.

§expected_version: u32

The expected version of the child metadata.

§new_version: u32

The actual version of the child metadata.

§

MissingMetadataDescription

The parent metadata does not contain a description of the child metadata.

Fields

§parent_role: MetadataPath

The parent metadata that contains the child metadata’s description.

§child_role: MetadataPath

The child metadata that should have been contained in the parent.

§

UnauthorizedDelegation

The parent metadata did not delegate to the child role.

Fields

§parent_role: MetadataPath

The parent metadata that did not delegate to the child.

§child_role: MetadataPath

That child metadata that was not delegated to by the parent.

§

MissingPrivateKey

The metadata must be signed with at least one private key.

Fields

§role: MetadataPath

The metadata to be signed.

Trait Implementations§

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 Error for Error

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 From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze 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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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 = 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more