Struct coins_ledger::common::APDUAnswer [−][src]
An APDU response is a wrapper around some response bytes. To avoid unnecessary clones, it exposes the retcode and response data as getters.
Implementations
impl APDUAnswer
[src]
pub fn from_answer(response: Vec<u8>) -> Result<APDUAnswer, LedgerError>
[src]
instantiate a
pub fn len(&self) -> usize
[src]
Return the response length in bytes
pub fn is_empty(&self) -> bool
[src]
True if the underlying slice is empty, else false.
pub fn is_success(&self) -> bool
[src]
Return false if the response status is an error.
pub fn retcode(&self) -> u16
[src]
Get the integer response code from the response packet.
Panics if the buffer is too short (some device error).
pub fn response_status(&self) -> APDUResponseCodes
[src]
Return the Response code
Panics on unknown retcode.
pub fn data(&self) -> Option<&[u8]>
[src]
Return a reference to the response data, or None if the response errored
Trait Implementations
impl Clone for APDUAnswer
[src]
fn clone(&self) -> APDUAnswer
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for APDUAnswer
[src]
impl Display for APDUAnswer
[src]
impl Eq for APDUAnswer
[src]
impl PartialEq<APDUAnswer> for APDUAnswer
[src]
fn eq(&self, other: &APDUAnswer) -> bool
[src]
fn ne(&self, other: &APDUAnswer) -> bool
[src]
impl StructuralEq for APDUAnswer
[src]
impl StructuralPartialEq for APDUAnswer
[src]
Auto Trait Implementations
impl RefUnwindSafe for APDUAnswer
impl Send for APDUAnswer
impl Sync for APDUAnswer
impl Unpin for APDUAnswer
impl UnwindSafe for APDUAnswer
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,