Exchange

Trait 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 'life0: 'async_trait,
             'life1: 'async_trait,
             I: Deref<Target = [u8]> + Send + Sync + 'async_trait,
             Self: '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 'life0: 'async_trait, 'life1: 'async_trait, I: Deref<Target = [u8]> + Send + Sync + 'async_trait, Self: 'async_trait,

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§