#[non_exhaustive]
pub enum Status {
Show 50 variants Success, MoreAvailable(u8), DataUnchangedWarning, WarningTriggering(u8), CorruptedData, UnexpectedEof, SelectFileDeactivated, FileControlInfoBadlyFormatted, SelectedFileInTerminationState, NoInputDataFromSensor, VerificationFailed, FilledByLastWrite, RemainingRetries(u8), UnspecifiedNonpersistentExecutionError, ImmediateResponseRequired, ErrorTriggering(u8), UnspecifiedPersistentExecutionError, MemoryFailure, WrongLength, ClaNotSupported, LogicalChannelNotSupported, SecureMessagingNotSupported, LastCommandOfChainExpected, CommandChainingNotSupported, CommandNotAllowed, CommandIncompatibleFileStructure, SecurityStatusNotSatisfied, OperationBlocked, ReferenceDataNotUsable, ConditionsOfUseNotSatisfied, CommandNotAllowedNoEf, ExectedSecureMessagingDataObjectsMissing, IncorrectSecureMessagingDataObjects, WrongParametersNoInfo, IncorrectDataParameter, FunctionNotSupported, NotFound, RecordNotFound, NotEnoughMemory, NcInconsistentWithTlv, IncorrectP1OrP2Parameter, NcInconsistentWithP1p2, KeyReferenceNotFound, FileAlreadyExists, DfNameAlreadyExists, WrongParameters, WrongLeField(u8), InstructionNotSupportedOrInvalid, ClassNotSupported, UnspecifiedCheckingError,
}
Expand description

Enum helping matching the SW1-SW2 bytes defined in 5.1.3

This enums helps matching against most status bytes.

Some valid status bytes values may not be supported. This enums still implements From<u16> through a #[doc_hidden] variant. This makes the following possible even though there is no variant for the 0x1234 value:

use iso7816::Status;
const CUSTOM_STATUS: Status = Status::from_u16(0x1234);
let status: Status = 0x1234.into();
match status {
    CUSTOM_STATUS => println!("Success"),
    _ => unreachable!(),
}

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

Success

0x900

§

MoreAvailable(u8)

0x6100 to 0x61FF

§

DataUnchangedWarning

0x6200

§

WarningTriggering(u8)

0x6202

Triggering by the card

The count must be within 0x02..=0x80

§

CorruptedData

0x6281

§

UnexpectedEof

0x6282

§

SelectFileDeactivated

0x6283

§

FileControlInfoBadlyFormatted

0x6284

§

SelectedFileInTerminationState

0x6285

§

NoInputDataFromSensor

0x6286

§

VerificationFailed

0x6300

Data changed warning

Name kept for backwards compatibility

§

FilledByLastWrite

0x6381

§

RemainingRetries(u8)

0x63C0 to 0x63CF

Generic Warning Counter

Meaning depends on the command

The count must be within 0x00..=0x0F

§

UnspecifiedNonpersistentExecutionError

0x6400

Execution Error

§

ImmediateResponseRequired

0x6401

§

ErrorTriggering(u8)

0x6402 to 0x6480

Triggering by the card

The count must be within 0x02..=0x80

§

UnspecifiedPersistentExecutionError

0x6500

Data Changed Error

§

MemoryFailure

0x6581

§

WrongLength

0x6700

§

ClaNotSupported

0x6800

§

LogicalChannelNotSupported

0x6881

§

SecureMessagingNotSupported

0x6882

§

LastCommandOfChainExpected

0x6883

§

CommandChainingNotSupported

0x6884

§

CommandNotAllowed

0x6900

§

CommandIncompatibleFileStructure

0x6981

§

SecurityStatusNotSatisfied

0x6982

§

OperationBlocked

0x6983

AuthenticationMethodBlocked

Name kept for backwards compatiblity

§

ReferenceDataNotUsable

0x6984

§

ConditionsOfUseNotSatisfied

0x6985

§

CommandNotAllowedNoEf

0x6986

§

ExectedSecureMessagingDataObjectsMissing

0x6987

§

IncorrectSecureMessagingDataObjects

0x6988

§

WrongParametersNoInfo

0x6A00

§

IncorrectDataParameter

0x6A80

§

FunctionNotSupported

0x6A81

§

NotFound

0x6A82

FileOrAppNotFound

Name kept for backwards compatibility

§

RecordNotFound

0x6A83

§

NotEnoughMemory

0x6A84

§

NcInconsistentWithTlv

0x6A85

§

IncorrectP1OrP2Parameter

0x6A86

§

NcInconsistentWithP1p2

0x6A87

§

KeyReferenceNotFound

0x6A88

Reference not found

Name kept for backwards compatibility

§

FileAlreadyExists

0x6A89

§

DfNameAlreadyExists

0x6A8A

§

WrongParameters

0x6B00

§

WrongLeField(u8)

0x6C00 to 0x6CFF

§

InstructionNotSupportedOrInvalid

0x6D00

§

ClassNotSupported

0x6E00

§

UnspecifiedCheckingError

0x6F00

Implementations§

source§

impl Status

source

pub const CHECKING_ERROR: u16 = 28_416u16

source

pub const fn from_u16(sw: u16) -> Status

source

pub const fn to_u16(&self) -> u16

Trait Implementations§

source§

impl Clone for Status

source§

fn clone(&self) -> Status

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Status

source§

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

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

impl Default for Status

source§

fn default() -> Status

Returns the “default value” for a type. Read more
source§

impl From<[u8; 2]> for Status

source§

fn from(sw: [u8; 2]) -> Status

Converts to this type from the input type.
source§

impl From<(u8, u8)> for Status

source§

fn from(_: (u8, u8)) -> Status

Converts to this type from the input type.
source§

impl<const S: usize> From<Status> for Vec<u8, S>

source§

fn from(status: Status) -> Vec<u8, S>

Converts to this type from the input type.
source§

impl From<u16> for Status

source§

fn from(sw: u16) -> Status

Converts to this type from the input type.
source§

impl PartialEq for Status

source§

fn eq(&self, other: &Status) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Status

source§

impl Eq for Status

source§

impl StructuralEq for Status

source§

impl StructuralPartialEq for Status

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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.