Skip to main content

AnyApdu

Enum AnyApdu 

Source
#[non_exhaustive]
pub enum AnyApdu<'a> {
Show 41 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), Tune(Tune), Replace(Replace), ClearReplace(ClearReplace), AskRelease(AskRelease), Text(Text<'a>), Enq(Enq<'a>), Answ(Answ<'a>), Menu(Menu<'a>), MenuAnsw(MenuAnsw), List(List<'a>), DisplayControl(DisplayControl), DisplayReply(DisplayReply), KeypadControl(KeypadControl), Keypress(Keypress), SubtitleSegment(SubtitleSegment<'a>), DisplayMessage(DisplayMessage), SceneEndMark(SceneEndMark), SceneDoneMessage(SceneDoneMessage), SceneControl(SceneControl), SubtitleDownload(SubtitleDownload<'a>), FlushDownload(FlushDownload), DownloadReply(DownloadReply), CommsCmd(CommsCmd<'a>), ConnectionDescriptor(ConnectionDescriptor<'a>), CommsReply(CommsReply), CommsSend(CommsSend<'a>), CommsRcv(CommsRcv<'a>), 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)

§

Tune(Tune)

§

Replace(Replace)

§

ClearReplace(ClearReplace)

§

AskRelease(AskRelease)

§

Text(Text<'a>)

§

Enq(Enq<'a>)

§

Answ(Answ<'a>)

§

Menu(Menu<'a>)

§

MenuAnsw(MenuAnsw)

§

List(List<'a>)

§

DisplayControl(DisplayControl)

§

DisplayReply(DisplayReply)

§

KeypadControl(KeypadControl)

§

Keypress(Keypress)

§

SubtitleSegment(SubtitleSegment<'a>)

§

DisplayMessage(DisplayMessage)

§

SceneEndMark(SceneEndMark)

§

SceneDoneMessage(SceneDoneMessage)

§

SceneControl(SceneControl)

§

SubtitleDownload(SubtitleDownload<'a>)

§

FlushDownload(FlushDownload)

§

DownloadReply(DownloadReply)

§

CommsCmd(CommsCmd<'a>)

§

ConnectionDescriptor(ConnectionDescriptor<'a>)

§

CommsReply(CommsReply)

§

CommsSend(CommsSend<'a>)

§

CommsRcv(CommsRcv<'a>)

§

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

Fields

§tag: ApduTag

The raw 3-byte apdu_tag.

§body: &'a [u8]

The raw body bytes.

Implementations§

Source§

impl<'a> AnyApdu<'a>

Source

pub const DISPATCHED_TAGS: &'static [ApduTag]

Every apdu_tag the generated dispatcher routes (excludes AnyApdu::Unknown).

Source

pub fn name(&self) -> &'static str

Diagnostic SCREAMING_SNAKE name of the contained object (ApduDef::NAME); "UNKNOWN" for AnyApdu::Unknown.

Source

pub fn tag(&self) -> ApduTag

The object’s apdu_tag.

Source

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§

Source§

impl<'a> Clone for AnyApdu<'a>

Source§

fn clone(&self) -> AnyApdu<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for AnyApdu<'a>

Source§

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

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

impl<'a> Eq for AnyApdu<'a>

Source§

impl<'a> From<Answ<'a>> for AnyApdu<'a>

Source§

fn from(v: Answ<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<ApplicationInfo<'a>> for AnyApdu<'a>

Source§

fn from(v: ApplicationInfo<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<ApplicationInfoEnq> for AnyApdu<'a>

Source§

fn from(v: ApplicationInfoEnq) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<AskRelease> for AnyApdu<'a>

Source§

fn from(v: AskRelease) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<CaInfo> for AnyApdu<'a>

Source§

fn from(v: CaInfo) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<CaInfoEnq> for AnyApdu<'a>

Source§

fn from(v: CaInfoEnq) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<CaPmt<'a>> for AnyApdu<'a>

Source§

fn from(v: CaPmt<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<CaPmtReply> for AnyApdu<'a>

Source§

fn from(v: CaPmtReply) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<ClearReplace> for AnyApdu<'a>

Source§

fn from(v: ClearReplace) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<CloseMmi> for AnyApdu<'a>

Source§

fn from(v: CloseMmi) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<CommsCmd<'a>> for AnyApdu<'a>

Source§

fn from(v: CommsCmd<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<CommsRcv<'a>> for AnyApdu<'a>

Source§

fn from(v: CommsRcv<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<CommsReply> for AnyApdu<'a>

Source§

fn from(v: CommsReply) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<CommsSend<'a>> for AnyApdu<'a>

Source§

fn from(v: CommsSend<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<ConnectionDescriptor<'a>> for AnyApdu<'a>

Source§

fn from(v: ConnectionDescriptor<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<DateTime> for AnyApdu<'a>

Source§

fn from(v: DateTime) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<DateTimeEnq> for AnyApdu<'a>

Source§

fn from(v: DateTimeEnq) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<DisplayControl> for AnyApdu<'a>

Source§

fn from(v: DisplayControl) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<DisplayMessage> for AnyApdu<'a>

Source§

fn from(v: DisplayMessage) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<DisplayReply> for AnyApdu<'a>

Source§

fn from(v: DisplayReply) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<DownloadReply> for AnyApdu<'a>

Source§

fn from(v: DownloadReply) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Enq<'a>> for AnyApdu<'a>

Source§

fn from(v: Enq<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<EnterMenu> for AnyApdu<'a>

Source§

fn from(v: EnterMenu) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<FlushDownload> for AnyApdu<'a>

Source§

fn from(v: FlushDownload) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<KeypadControl> for AnyApdu<'a>

Source§

fn from(v: KeypadControl) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Keypress> for AnyApdu<'a>

Source§

fn from(v: Keypress) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<List<'a>> for AnyApdu<'a>

Source§

fn from(v: List<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Menu<'a>> for AnyApdu<'a>

Source§

fn from(v: Menu<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<MenuAnsw> for AnyApdu<'a>

Source§

fn from(v: MenuAnsw) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Profile> for AnyApdu<'a>

Source§

fn from(v: Profile) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<ProfileChange> for AnyApdu<'a>

Source§

fn from(v: ProfileChange) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<ProfileEnq> for AnyApdu<'a>

Source§

fn from(v: ProfileEnq) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Replace> for AnyApdu<'a>

Source§

fn from(v: Replace) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<SceneControl> for AnyApdu<'a>

Source§

fn from(v: SceneControl) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<SceneDoneMessage> for AnyApdu<'a>

Source§

fn from(v: SceneDoneMessage) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<SceneEndMark> for AnyApdu<'a>

Source§

fn from(v: SceneEndMark) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<SubtitleDownload<'a>> for AnyApdu<'a>

Source§

fn from(v: SubtitleDownload<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<SubtitleSegment<'a>> for AnyApdu<'a>

Source§

fn from(v: SubtitleSegment<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Text<'a>> for AnyApdu<'a>

Source§

fn from(v: Text<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Tune> for AnyApdu<'a>

Source§

fn from(v: Tune) -> Self

Converts to this type from the input type.
Source§

impl<'a> PartialEq for AnyApdu<'a>

Source§

fn eq(&self, other: &AnyApdu<'a>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<'a> Serialize for AnyApdu<'a>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Serialize for AnyApdu<'_>

Source§

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

Number of bytes serialize_into will write.
Source§

fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>

Write the serialised form into buf. Returns the number of bytes written (always equal to serialized_len()).
Source§

fn to_bytes(&self) -> Vec<u8>
where Self::Error: Debug,

Convenience: allocate a Vec and serialise into it. Read more
Source§

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DescriptorObject for T
where T: Debug + Any + Send + Sync,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Borrow as &dyn Any so the caller can downcast to the concrete type.
Source§

impl<T> ExtensionObject for T
where T: Debug + Any + Send + Sync,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Borrow as &dyn Any so the caller can downcast to the concrete type.
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> TableObject for T
where T: Debug + Any + Send + Sync,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Borrow as &dyn Any so the caller can downcast to the concrete type.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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.