Struct iota_ledger::ledger_apdu::APDUAnswer
source · [−]pub struct APDUAnswer<B> { /* private fields */ }
Expand description
An APDU answer, whole last 2 bytes are interpreted as retcode
Implementations
sourceimpl<B> APDUAnswer<B> where
B: Deref<Target = [u8]>,
impl<B> APDUAnswer<B> where
B: Deref<Target = [u8]>,
sourcepub fn from_answer(answer: B) -> Result<APDUAnswer<B>, APDUAnswerError>
pub fn from_answer(answer: B) -> Result<APDUAnswer<B>, APDUAnswerError>
Attempt to interpret the given slice as an APDU answer
sourcepub fn apdu_data(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn apdu_data(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Will return the answer’s payload
sourcepub fn data(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn data(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Will return the answer’s payload
sourcepub fn error_code(&self) -> Result<APDUErrorCode, u16>
pub fn error_code(&self) -> Result<APDUErrorCode, u16>
Will attempt to interpret the error code as an APDUErrorCode, returning the code as is otherwise
Trait Implementations
Auto Trait Implementations
impl<B> RefUnwindSafe for APDUAnswer<B> where
B: RefUnwindSafe,
impl<B> Send for APDUAnswer<B> where
B: Send,
impl<B> Sync for APDUAnswer<B> where
B: Sync,
impl<B> Unpin for APDUAnswer<B> where
B: Unpin,
impl<B> UnwindSafe for APDUAnswer<B> where
B: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more