Trait coins_ledger::transports::LedgerAsync
source · pub trait LedgerAsync: Sized {
// Required methods
fn init<'async_trait>( ) -> Pin<Box<dyn Future<Output = Result<Self, LedgerError>> + Send + 'async_trait>>
where Self: 'async_trait;
fn exchange<'life0, 'life1, 'async_trait>(
&'life0 self,
packet: &'life1 APDUCommand,
) -> Pin<Box<dyn Future<Output = Result<APDUAnswer, LedgerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn close(self) { ... }
}
Expand description
An asynchronous interface to the Ledger device. It is critical that the
device have only one connection active, so the init
funnction acquires a
lock on the device.
Required Methods§
sourcefn init<'async_trait>() -> Pin<Box<dyn Future<Output = Result<Self, LedgerError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn init<'async_trait>() -> Pin<Box<dyn Future<Output = Result<Self, LedgerError>> + Send + 'async_trait>>where
Self: 'async_trait,
Init the connection to the device. This may fail if the device is already in use by some other process.
sourcefn exchange<'life0, 'life1, 'async_trait>(
&'life0 self,
packet: &'life1 APDUCommand,
) -> Pin<Box<dyn Future<Output = Result<APDUAnswer, LedgerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn exchange<'life0, 'life1, 'async_trait>(
&'life0 self,
packet: &'life1 APDUCommand,
) -> Pin<Box<dyn Future<Output = Result<APDUAnswer, LedgerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Exchange a packet with the device.
Provided Methods§
Object Safety§
This trait is not object safe.
Implementors§
impl LedgerAsync for Ledger
Available on non-WebAssembly only.