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
NegativeInteger
Negative integer encountered where unsigned was expected.
Fields
EmptyFieldKey
Field key is empty.
InvalidFieldKey
Field key contains invalid characters.
ReservedKeyAsExtension
Attempted to use a reserved key name as an extension.
InvalidExtensionKeyFormat
Extension key does not match required pattern x_<app>_<field>.
Fields
FieldTooShort
String field is shorter than minimum length.
Fields
FieldTooLong
String field exceeds maximum length.
Fields
NulByteInValue
NUL byte (0x00) found in string value.
MissingRequiredField
Required field is missing from the AAD object.
DuplicateKey
Duplicate key found in JSON object.
UnknownField
Unknown field for the specified schema version.
UnsupportedVersion
Unsupported schema version.
WrongFieldType
Field has wrong type (e.g., string instead of integer).
Fields
SerializedTooLarge
Serialized AAD exceeds the 16 KiB limit.
InvalidJson
Invalid JSON syntax or structure.
InvalidFloat
Non-integer or non-finite float where an integer was required.
Trait Implementations§
Source§impl Error for AadError
impl Error for AadError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()