Skip to main content

AionError

Enum AionError 

Source
#[non_exhaustive]
pub enum AionError {
Show 36 variants FileReadError { path: PathBuf, source: Error, }, FileWriteError { path: PathBuf, source: Error, }, FileExists { path: PathBuf, }, FileNotFound { path: PathBuf, }, PermissionDenied { path: PathBuf, }, InvalidFormat { reason: String, }, CorruptedFile { expected: String, actual: String, }, UnsupportedVersion { version: u16, supported: String, }, InvalidHeader { reason: String, }, SignatureVerificationFailed { version: u64, author: AuthorId, }, InvalidSignature { reason: String, }, UnauthorizedSigner { author: AuthorId, version: u64, }, KeyMismatch { author: AuthorId, epoch: u32, }, DecryptionFailed { reason: String, }, EncryptionFailed { reason: String, }, HashMismatch { expected: [u8; 32], actual: [u8; 32], }, InvalidPrivateKey { reason: String, }, InvalidPublicKey { reason: String, }, BrokenVersionChain { version: u64, }, InvalidVersionNumber { version: u64, current: u64, }, VersionOverflow { max: u64, }, MissingVersion { version: u64, }, KeyNotFound { author_id: AuthorId, reason: String, }, KeyringAccessDenied { reason: String, }, KeyStoreFailed { reason: String, }, KeyringError { operation: String, reason: String, }, InvalidFileId { file_id: u64, }, InvalidAuthorId { author_id: u64, }, InvalidTimestamp { reason: String, }, InvalidActionCode { code: u16, }, BrokenAuditChain { expected: [u8; 32], actual: [u8; 32], }, InvalidUtf8 { reason: String, }, RulesTooLarge { size: usize, max: usize, }, OperationNotPermitted { operation: String, required: String, }, Conflict { reason: String, }, ResourceExhausted { resource: String, },
}
Expand description

Top-level error type for AION v2

All errors provide contextual information to aid debugging and suggest solutions to users. Errors are organized by category for clarity.

#[non_exhaustive] because the crate is under active development — new error categories will land for crypto rotations, hardware attestation, transparency-log proofs, and additional compliance frameworks. Adding a variant should not force every downstream consumer’s exhaustive match to update on a minor release.

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.
§

FileReadError

Failed to read a file

Fields

§path: PathBuf

Path to the file that couldn’t be read

§source: Error

Underlying I/O error

§

FileWriteError

Failed to write a file

Fields

§path: PathBuf

Path to the file that couldn’t be written

§source: Error

Underlying I/O error

§

FileExists

File already exists

Fields

§path: PathBuf

Path to the existing file

§

FileNotFound

File not found

Fields

§path: PathBuf

Path to the missing file

§

PermissionDenied

Permission denied

Fields

§path: PathBuf

Path to the file with permission issues

§

InvalidFormat

Invalid file format

Fields

§reason: String

Description of the format issue

§

CorruptedFile

Corrupted file detected via checksum mismatch

Fields

§expected: String

Expected checksum

§actual: String

Actual checksum

§

UnsupportedVersion

Unsupported file version

Fields

§version: u16

Version found in the file

§supported: String

Supported versions

§

InvalidHeader

Invalid file header

Fields

§reason: String

Description of header issue

§

SignatureVerificationFailed

Signature verification failed

Fields

§version: u64

Version number that failed verification

§author: AuthorId

Author ID

§

InvalidSignature

Invalid signature

Fields

§reason: String

Description of signature issue

§

UnauthorizedSigner

A commit was attempted by a signer the registry has no active epoch for at the target version (issue #25). The write was refused before any bytes were emitted.

Fields

§author: AuthorId

The author that attempted to sign.

§version: u64

The version number the commit would have produced.

§

KeyMismatch

The supplied signing key’s public half does not match the operational key pinned in the registry for this author’s active epoch (issue #25). Most often means the caller used a rotated- out key.

Fields

§author: AuthorId

The author that attempted to sign.

§epoch: u32

The registry epoch number that pinned a different public key.

§

DecryptionFailed

Decryption failed

Fields

§reason: String

Description of decryption failure

§

EncryptionFailed

Encryption failed

Fields

§reason: String

Description of encryption failure

§

HashMismatch

Hash mismatch after decryption

Fields

§expected: [u8; 32]

Expected hash value

§actual: [u8; 32]

Actual hash value

§

InvalidPrivateKey

Invalid private key

Fields

§reason: String

Description of key issue

§

InvalidPublicKey

Invalid public key

Fields

§reason: String

Description of key issue

§

BrokenVersionChain

Version chain integrity broken

Fields

§version: u64

Version where the chain breaks

§

InvalidVersionNumber

Invalid version number

Fields

§version: u64

Invalid version number

§current: u64

Current version

§

VersionOverflow

Version number overflow

Fields

§max: u64

Maximum version reached

§

MissingVersion

Missing version in chain

Fields

§version: u64

Missing version number

§

KeyNotFound

Key not found in keyring

Fields

§author_id: AuthorId

Author identifier

§reason: String

Description of the error

§

KeyringAccessDenied

Keyring access denied

Fields

§reason: String

Description of access issue

§

KeyStoreFailed

Failed to store key

Fields

§reason: String

Description of storage failure

§

KeyringError

Keyring operation error

Fields

§operation: String

Operation that failed

§reason: String

Description of the error

§

InvalidFileId

Invalid file ID

Fields

§file_id: u64

Invalid file ID value

§

InvalidAuthorId

Invalid author ID

Fields

§author_id: u64

Invalid author ID value

§

InvalidTimestamp

Invalid timestamp

Fields

§reason: String

Description of timestamp issue

§

InvalidActionCode

Invalid action code

Fields

§code: u16

Invalid action code value

§

BrokenAuditChain

Broken audit chain

Fields

§expected: [u8; 32]

Expected previous hash

§actual: [u8; 32]

Actual previous hash

§

InvalidUtf8

Invalid UTF-8 encoding

Fields

§reason: String

Description of UTF-8 validation failure

§

RulesTooLarge

Rules too large

Fields

§size: usize

Actual size

§max: usize

Maximum allowed size

§

OperationNotPermitted

Operation not permitted

Fields

§operation: String

Operation attempted

§required: String

Required permission/state

§

Conflict

Conflicting operation

Fields

§reason: String

Description of conflict

§

ResourceExhausted

Resource exhausted

Fields

§resource: String

Resource that was exhausted

Trait Implementations§

Source§

impl Debug for AionError

Source§

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

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

impl Display for AionError

Source§

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

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

impl Error for AionError

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

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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