Trait ledger_transport::Exchange

source ·
pub trait Exchange {
    type Error;
    type AnswerType: Deref<Target = [u8]> + Send;

    // Required method
    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 + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Use to talk to the ledger device

Required Associated Types§

source

type Error

Error defined by Transport used

source

type AnswerType: Deref<Target = [u8]> + Send

The concrete type containing the APDUAnswer

Required Methods§

source

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 + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send a command with the given transport and retrieve an answer or a transport error

Object Safety§

This trait is not object safe.

Implementors§