Struct coins_ledger::transports::native::LedgerHandle
source · pub struct LedgerHandle { /* private fields */ }
Expand description
A handle to the Ledger device. This handle is not clone, as it is critical that only one connection to the device is active at a time. APDUs may NOT be interleaved.
Implementations§
source§impl LedgerHandle
impl LedgerHandle
sourcepub fn init() -> Result<Self, LedgerError>
pub fn init() -> Result<Self, LedgerError>
Init a handle, and spawn a task to manage Ledger packet exchange.
sourcepub async fn exchange(
&self,
apdu: APDUCommand,
) -> Result<APDUAnswer, LedgerError>
pub async fn exchange( &self, apdu: APDUCommand, ) -> Result<APDUAnswer, LedgerError>
Exchange a packet with the device.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LedgerHandle
impl !RefUnwindSafe for LedgerHandle
impl Send for LedgerHandle
impl Sync for LedgerHandle
impl Unpin for LedgerHandle
impl !UnwindSafe for LedgerHandle
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