Struct ledger_transport_hid::TransportNativeHID
source · [−]pub struct TransportNativeHID { /* private fields */ }
Implementations
sourceimpl TransportNativeHID
impl TransportNativeHID
sourcepub fn list_ledgers(api: &HidApi) -> impl Iterator<Item = &DeviceInfo>
pub fn list_ledgers(api: &HidApi) -> impl Iterator<Item = &DeviceInfo>
Get a list of ledger devices available
sourcepub fn new(api: &HidApi) -> Result<Self, LedgerHIDError>
pub fn new(api: &HidApi) -> Result<Self, LedgerHIDError>
sourcepub fn open_device(
api: &HidApi,
device: &DeviceInfo
) -> Result<Self, LedgerHIDError>
pub fn open_device(
api: &HidApi,
device: &DeviceInfo
) -> Result<Self, LedgerHIDError>
pub fn exchange<I: Deref<Target = [u8]>>(
&self,
command: &APDUCommand<I>
) -> Result<APDUAnswer<Vec<u8>>, LedgerHIDError>
Trait Implementations
sourceimpl Exchange for TransportNativeHID
impl Exchange for TransportNativeHID
type Error = LedgerHIDError
type Error = LedgerHIDError
Error defined by Transport used
type AnswerType = Vec<u8>
type AnswerType = Vec<u8>
The concrete type containing the APDUAnswer
sourcefn exchange<'life0, 'life1, 'async_trait, I>(
&'life0 self,
command: &'life1 APDUCommand<I>
) -> Pin<Box<dyn Future<Output = Result<APDUAnswer<Self::AnswerType>, Self::Error>> + Send + 'async_trait>> where
I: Deref<Target = [u8]> + Send + Sync,
I: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn exchange<'life0, 'life1, 'async_trait, I>(
&'life0 self,
command: &'life1 APDUCommand<I>
) -> Pin<Box<dyn Future<Output = Result<APDUAnswer<Self::AnswerType>, Self::Error>> + Send + 'async_trait>> where
I: Deref<Target = [u8]> + Send + Sync,
I: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Send a command with the given transport and retrieve an answer or a transport error
Auto Trait Implementations
impl RefUnwindSafe for TransportNativeHID
impl Send for TransportNativeHID
impl Sync for TransportNativeHID
impl Unpin for TransportNativeHID
impl UnwindSafe for TransportNativeHID
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