#[non_exhaustive]pub enum Error {
BufferTooShort {
need: usize,
have: usize,
what: &'static str,
},
OutputBufferTooSmall {
need: usize,
have: usize,
},
UnexpectedApduTag {
got: u32,
expected: u32,
what: &'static str,
},
UnexpectedSpduTag {
got: u8,
expected: u8,
what: &'static str,
},
UnexpectedTpduTag {
got: u8,
expected: u8,
what: &'static str,
},
InvalidLength(&'static str),
LengthTooLarge(usize),
LengthMismatch {
what: &'static str,
declared: usize,
actual: usize,
},
InvalidObject {
what: &'static str,
reason: &'static str,
},
UnknownResource {
resource_id: u32,
},
}Expand description
A Common Interface parse or serialize error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BufferTooShort
Input shorter than required.
Fields
OutputBufferTooSmall
Output buffer smaller than serialized_len().
UnexpectedApduTag
An object’s 3-byte apdu_tag did not match the expected value.
Fields
UnexpectedSpduTag
A 1-byte spdu_tag did not match the expected value.
Fields
UnexpectedTpduTag
A 1-byte tpdu_tag did not match the expected value.
Fields
InvalidLength(&'static str)
The ASN.1-style length_field was malformed (truncated, or a
declared length running past the buffer).
LengthTooLarge(usize)
A length_field encoded a value too large to represent (the spec caps
any length at 65535, i.e. at most 3 length bytes).
LengthMismatch
A declared length_field did not match the actual body length, or the
body did not fit the fixed shape the object requires.
Fields
InvalidObject
A fixed-shape object had a body length the spec does not allow.
UnknownResource
A resource_identifier() did not map to any CI-extension resource that
crate::ci_ext::CiExtApdu can dispatch.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
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()