Enum ledger_apdu::APDUErrorCode
source · #[repr(u16)]pub enum APDUErrorCode {
Show 14 variants
NoError = 36_864,
ExecutionError = 25_600,
WrongLength = 26_368,
EmptyBuffer = 27_010,
OutputBufferTooSmall = 27_011,
DataInvalid = 27_012,
ConditionsNotSatisfied = 27_013,
CommandNotAllowed = 27_014,
BadKeyHandle = 27_264,
InvalidP1P2 = 27_392,
InsNotSupported = 27_904,
ClaNotSupported = 28_160,
Unknown = 28_416,
SignVerifyError = 28_417,
}
Expand description
Common known APDU error codes
Variants§
NoError = 36_864
success
ExecutionError = 25_600
error during apdu execution
WrongLength = 26_368
apdu command wrong length
EmptyBuffer = 27_010
empty apdu buffer
OutputBufferTooSmall = 27_011
apdu buffer too small
DataInvalid = 27_012
apdu parameters invalid
ConditionsNotSatisfied = 27_013
apdu preconditions not satisfied
CommandNotAllowed = 27_014
apdu command not allowed
BadKeyHandle = 27_264
apdu data field incorrect (bad key)
InvalidP1P2 = 27_392
apdu p1 or p2 incorrect
InsNotSupported = 27_904
apdu instruction not supported or invalid
ClaNotSupported = 28_160
apdu class not supported or invalid
Unknown = 28_416
unknown apdu error
SignVerifyError = 28_417
apdu sign verify error
Implementations§
source§impl APDUErrorCode
impl APDUErrorCode
sourcepub fn description(&self) -> String
pub fn description(&self) -> String
Quick-hand to retrieve the error code’s description / display
Trait Implementations§
source§impl Clone for APDUErrorCode
impl Clone for APDUErrorCode
source§fn clone(&self) -> APDUErrorCode
fn clone(&self) -> APDUErrorCode
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for APDUErrorCode
impl Debug for APDUErrorCode
source§impl Display for APDUErrorCode
impl Display for APDUErrorCode
source§impl Error for APDUErrorCode
impl Error for APDUErrorCode
source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§impl ErrorCompat for APDUErrorCode
impl ErrorCompat for APDUErrorCode
source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Returns an iterator for traversing the chain of errors,
starting with the current error
and continuing with recursive calls to
Error::source
. Read moresource§impl From<APDUErrorCode> for u16
impl From<APDUErrorCode> for u16
source§fn from(code: APDUErrorCode) -> Self
fn from(code: APDUErrorCode) -> Self
Converts to this type from the input type.
source§impl PartialEq for APDUErrorCode
impl PartialEq for APDUErrorCode
source§fn eq(&self, other: &APDUErrorCode) -> bool
fn eq(&self, other: &APDUErrorCode) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TryFrom<u16> for APDUErrorCode
impl TryFrom<u16> for APDUErrorCode
impl Copy for APDUErrorCode
impl Eq for APDUErrorCode
impl StructuralPartialEq for APDUErrorCode
Auto Trait Implementations§
impl Freeze for APDUErrorCode
impl RefUnwindSafe for APDUErrorCode
impl Send for APDUErrorCode
impl Sync for APDUErrorCode
impl Unpin for APDUErrorCode
impl UnwindSafe for APDUErrorCode
Blanket Implementations§
source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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