Struct iso7816::command::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<Self, FromSliceError>

source

pub fn class(&self) -> Class

source

pub fn instruction(&self) -> Instruction

source

pub fn data(&self) -> &Data<S>

source

pub fn data_mut(&mut self) -> &mut Data<S>

source

pub fn expected(&self) -> usize

source

pub fn as_view(&self) -> CommandView<'_>

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
source

pub fn extend_from_command_view( &mut self, command: CommandView<'_> ) -> 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

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

impl<const S: usize> PartialEq 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<Self, Self::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 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.