pub struct Command<'a> {
pub cla: u8,
pub ins: u8,
pub p1: u8,
pub p2: u8,
pub le: Option<u16>,
pub payload: Option<&'a [u8]>,
}
Expand description
An APDU command to be transmitted
Fields§
§cla: u8
§ins: u8
§p1: u8
§p2: u8
§le: Option<u16>
§payload: Option<&'a [u8]>
Implementations§
Source§impl<'a> Command<'a>
impl<'a> Command<'a>
Sourcepub fn new(cla: u8, ins: u8, p1: u8, p2: u8) -> Self
pub fn new(cla: u8, ins: u8, p1: u8, p2: u8) -> Self
Constructs an command with CLA, INS, P1, and P2. No payloads will be transmitted or received.
Sourcepub fn new_with_le(cla: u8, ins: u8, p1: u8, p2: u8, le: u16) -> Self
pub fn new_with_le(cla: u8, ins: u8, p1: u8, p2: u8, le: u16) -> Self
Constructs an command with CLA, INS, P1, P2, and Le. A payload will be received.
Sourcepub fn new_with_payload(
cla: u8,
ins: u8,
p1: u8,
p2: u8,
payload: &'a [u8],
) -> Self
pub fn new_with_payload( cla: u8, ins: u8, p1: u8, p2: u8, payload: &'a [u8], ) -> Self
Constructs an command with CLA, INS, P1, P2, and a payload. No payload will be received.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Command<'a>
impl<'a> RefUnwindSafe for Command<'a>
impl<'a> Send for Command<'a>
impl<'a> Sync for Command<'a>
impl<'a> Unpin for Command<'a>
impl<'a> UnwindSafe for Command<'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