#[non_exhaustive]
pub enum Error {
Show 15 variants BadSignature, Encoding(String), ExpiredMetadata(Role), IllegalArgument(String), Http(Error), BadHttpStatus { code: StatusCode, uri: String, }, Hyper(Error), MissingMetadata(Role), NoSupportedHashAlgorithm, NotFound, Opaque(String), Programming(String), TargetUnavailable, UnknownKeyType(String), VerificationFailure(String),
}
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

The metadata had a bad signature.

Encoding(String)

There was a problem encoding or decoding.

ExpiredMetadata(Role)

Metadata was expired.

IllegalArgument(String)

An illegal argument was passed into a function.

Http(Error)

Generic error for HTTP connections.

BadHttpStatus

Fields

code: StatusCode

HTTP status code.

uri: String

URI Resource that resulted in the error.

Unexpected HTTP response status.

Hyper(Error)

Errors that can occur parsing HTTP streams.

MissingMetadata(Role)

The metadata was missing, so an operation could not be completed.

NoSupportedHashAlgorithm

There were no available hash algorithms.

NotFound

The metadata or 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.

Programming(String)

There was a library internal error. These errors are ALWAYS bugs and should be reported.

TargetUnavailable

The target is unavailable. This may mean it is either not in the metadata or the metadata chain to the target cannot be fully verified.

UnknownKeyType(String)

There is no known or available key type.

VerificationFailure(String)

The metadata or target failed to verify.

Implementations

Helper to include the path that causd the error for FS I/O errors.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

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

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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