Struct apdu_dispatch::app::Command

source ·
pub struct Command<const S: usize> {
    pub p1: u8,
    pub p2: u8,
    pub extended: bool,
    /* private fields */
}

Fields§

§p1: u8§p2: u8§extended: bool

Implementations§

source§

impl<const S: usize> Command<S>

source

pub fn try_from(apdu: &[u8]) -> Result<Command<S>, FromSliceError>

source

pub fn class(&self) -> Class

source

pub fn instruction(&self) -> Instruction

source

pub fn data(&self) -> &Vec<u8, S>

source

pub fn data_mut(&mut self) -> &mut Vec<u8, S>

source

pub fn expected(&self) -> usize

source

pub fn extend_from_command<const T: usize>(
&mut self,
command: &Command<T>
) -> Result<(), ()>

This can be use for APDU chaining to convert multiple APDU’s into one.

  • Global Platform GPC_SPE_055 3.10

Trait Implementations§

source§

impl<const S: usize> Clone for Command<S>

source§

fn clone(&self) -> Command<S>

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<const S: usize> Debug for Command<S>

source§

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

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

impl<const S: usize> PartialEq<Command<S>> for Command<S>

source§

fn eq(&self, other: &Command<S>) -> 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<const S: usize> TryFrom<&[u8]> for Command<S>

§

type Error = FromSliceError

The type returned in the event of a conversion error.
source§

fn try_from(
apdu: &[u8]
) -> Result<Command<S>, <Command<S> as TryFrom<&[u8]>>::Error>

Performs the conversion.
source§

impl<const S: usize> Eq for Command<S>

source§

impl<const S: usize> StructuralEq for Command<S>

source§

impl<const S: usize> StructuralPartialEq for Command<S>

Auto Trait Implementations§

§

impl<const S: usize> RefUnwindSafe for Command<S>

§

impl<const S: usize> Send for Command<S>

§

impl<const S: usize> Sync for Command<S>

§

impl<const S: usize> Unpin for Command<S>

§

impl<const S: usize> UnwindSafe for Command<S>

Blanket Implementations§

source§

impl<T> Any for Twhere
T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
U: From<T>,

const: unstable · 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 Twhere
U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.