#[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,
},
}Expand description
A Common Interface parse or serialize error.
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.
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.
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more