#[non_exhaustive]pub enum AnyApdu<'a> {
Show 14 variants
ProfileEnq(ProfileEnq),
Profile(Profile),
ProfileChange(ProfileChange),
ApplicationInfoEnq(ApplicationInfoEnq),
ApplicationInfo(ApplicationInfo<'a>),
EnterMenu(EnterMenu),
CaInfoEnq(CaInfoEnq),
CaInfo(CaInfo),
CaPmt(CaPmt<'a>),
CaPmtReply(CaPmtReply),
DateTimeEnq(DateTimeEnq),
DateTime(DateTime),
CloseMmi(CloseMmi),
Unknown {
tag: ApduTag,
body: &'a [u8],
},
}Expand description
Every crate-implemented APDU object, plus an Unknown fallthrough
that preserves the raw APDU header + body for lossless round-trips.
serde uses external tagging with camelCase variant keys.
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.
ProfileEnq(ProfileEnq)
Profile(Profile)
ProfileChange(ProfileChange)
ApplicationInfoEnq(ApplicationInfoEnq)
ApplicationInfo(ApplicationInfo<'a>)
EnterMenu(EnterMenu)
CaInfoEnq(CaInfoEnq)
CaInfo(CaInfo)
CaPmt(CaPmt<'a>)
CaPmtReply(CaPmtReply)
DateTimeEnq(DateTimeEnq)
DateTime(DateTime)
CloseMmi(CloseMmi)
Unknown
An apdu_tag with no typed implementation; the fields are the
raw 3-byte tag and the verbatim body bytes (the length_value
bytes that followed the length_field).
Implementations§
Source§impl<'a> AnyApdu<'a>
impl<'a> AnyApdu<'a>
Sourcepub const DISPATCHED_TAGS: &'static [ApduTag]
pub const DISPATCHED_TAGS: &'static [ApduTag]
Every apdu_tag the generated dispatcher routes (excludes
AnyApdu::Unknown).
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
Diagnostic SCREAMING_SNAKE name of the contained object
(ApduDef::NAME); "UNKNOWN" for
AnyApdu::Unknown.
Sourcepub fn parse(bytes: &'a [u8]) -> Result<Self>
pub fn parse(bytes: &'a [u8]) -> Result<Self>
Parse a complete APDU (header + body) by routing on its 3-byte
apdu_tag. Unrecognised tags yield AnyApdu::Unknown.
Trait Implementations§
impl<'a> Eq for AnyApdu<'a>
Source§impl<'a> From<ApplicationInfo<'a>> for AnyApdu<'a>
impl<'a> From<ApplicationInfo<'a>> for AnyApdu<'a>
Source§fn from(v: ApplicationInfo<'a>) -> Self
fn from(v: ApplicationInfo<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> From<ApplicationInfoEnq> for AnyApdu<'a>
impl<'a> From<ApplicationInfoEnq> for AnyApdu<'a>
Source§fn from(v: ApplicationInfoEnq) -> Self
fn from(v: ApplicationInfoEnq) -> Self
Converts to this type from the input type.
Source§impl<'a> From<CaPmtReply> for AnyApdu<'a>
impl<'a> From<CaPmtReply> for AnyApdu<'a>
Source§fn from(v: CaPmtReply) -> Self
fn from(v: CaPmtReply) -> Self
Converts to this type from the input type.
Source§impl<'a> From<DateTimeEnq> for AnyApdu<'a>
impl<'a> From<DateTimeEnq> for AnyApdu<'a>
Source§fn from(v: DateTimeEnq) -> Self
fn from(v: DateTimeEnq) -> Self
Converts to this type from the input type.
Source§impl<'a> From<ProfileChange> for AnyApdu<'a>
impl<'a> From<ProfileChange> for AnyApdu<'a>
Source§fn from(v: ProfileChange) -> Self
fn from(v: ProfileChange) -> Self
Converts to this type from the input type.
Source§impl<'a> From<ProfileEnq> for AnyApdu<'a>
impl<'a> From<ProfileEnq> for AnyApdu<'a>
Source§fn from(v: ProfileEnq) -> Self
fn from(v: ProfileEnq) -> Self
Converts to this type from the input type.
Source§impl<'a> PartialEq for AnyApdu<'a>
impl<'a> PartialEq for AnyApdu<'a>
Source§impl Serialize for AnyApdu<'_>
impl Serialize for AnyApdu<'_>
Source§type Error = Error
type Error = Error
The error type this implementer returns (usually the same as the
corresponding
Parse impl, but need not be).Source§fn serialized_len(&self) -> usize
fn serialized_len(&self) -> usize
Number of bytes
serialize_into will write.impl<'a> StructuralPartialEq for AnyApdu<'a>
Auto Trait Implementations§
impl<'a> Freeze for AnyApdu<'a>
impl<'a> RefUnwindSafe for AnyApdu<'a>
impl<'a> Send for AnyApdu<'a>
impl<'a> Sync for AnyApdu<'a>
impl<'a> Unpin for AnyApdu<'a>
impl<'a> UnsafeUnpin for AnyApdu<'a>
impl<'a> UnwindSafe for AnyApdu<'a>
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