Skip to main content

AadError

Enum AadError 

Source
pub enum AadError {
Show 17 variants IntegerOutOfRange { field: String, value: u64, max: u64, }, NegativeInteger { field: String, value: i64, }, EmptyFieldKey, InvalidFieldKey { key: String, reason: String, }, ReservedKeyAsExtension { key: String, }, InvalidExtensionKeyFormat { key: String, expected_pattern: &'static str, }, FieldTooShort { field: &'static str, min_bytes: usize, actual_bytes: usize, }, FieldTooLong { field: &'static str, max_bytes: usize, actual_bytes: usize, }, NulByteInValue { field: &'static str, }, MissingRequiredField { field: &'static str, }, DuplicateKey { key: String, }, UnknownField { field: String, version: u64, }, UnsupportedVersion { version: u64, }, WrongFieldType { field: &'static str, expected: &'static str, actual: JsonType, }, SerializedTooLarge { max_bytes: usize, actual_bytes: usize, }, InvalidJson { message: String, }, InvalidFloat { field: String, reason: &'static str, },
}
Expand description

All possible errors during AAD parsing, validation, and canonicalization.

Variants§

§

IntegerOutOfRange

Integer value exceeds the safe range (0 to 2^53-1).

Fields

§field: String

The field whose value was out of range

§value: u64

The value that was out of range

§max: u64

The maximum allowed value (2^53-1)

§

NegativeInteger

Negative integer encountered where unsigned was expected.

Fields

§field: String

The field that received the negative value

§value: i64

The negative value encountered

§

EmptyFieldKey

Field key is empty.

§

InvalidFieldKey

Field key contains invalid characters.

Fields

§key: String

The invalid key

§reason: String

Explanation of why it’s invalid

§

ReservedKeyAsExtension

Attempted to use a reserved key name as an extension.

Fields

§key: String

The reserved key that was misused

§

InvalidExtensionKeyFormat

Extension key does not match required pattern x_<app>_<field>.

Fields

§key: String

The invalid extension key

§expected_pattern: &'static str

The expected pattern description

§

FieldTooShort

String field is shorter than minimum length.

Fields

§field: &'static str

The field name

§min_bytes: usize

Minimum required bytes

§actual_bytes: usize

Actual bytes provided

§

FieldTooLong

String field exceeds maximum length.

Fields

§field: &'static str

The field name

§max_bytes: usize

Maximum allowed bytes

§actual_bytes: usize

Actual bytes provided

§

NulByteInValue

NUL byte (0x00) found in string value.

Fields

§field: &'static str

The field containing the NUL byte

§

MissingRequiredField

Required field is missing from the AAD object.

Fields

§field: &'static str

The name of the missing field

§

DuplicateKey

Duplicate key found in JSON object.

Fields

§key: String

The duplicated key

§

UnknownField

Unknown field for the specified schema version.

Fields

§field: String

The unknown field name

§version: u64

The schema version

§

UnsupportedVersion

Unsupported schema version.

Fields

§version: u64

The unsupported version number

§

WrongFieldType

Field has wrong type (e.g., string instead of integer).

Fields

§field: &'static str

The field with wrong type

§expected: &'static str

The expected type

§actual: JsonType

The actual type found

§

SerializedTooLarge

Serialized AAD exceeds the 16 KiB limit.

Fields

§max_bytes: usize

Maximum allowed bytes (16384)

§actual_bytes: usize

Actual serialized size

§

InvalidJson

Invalid JSON syntax or structure.

Fields

§message: String

Description of the JSON error

§

InvalidFloat

Non-integer or non-finite float where an integer was required.

Fields

§field: String

The field name

§reason: &'static str

"NaN", "Infinity", "negative", "fractional", or "exceeds MAX_SAFE_INTEGER"

Trait Implementations§

Source§

impl Debug for AadError

Source§

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

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

impl Display for AadError

Source§

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

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

impl Error for AadError

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

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