Trait ledger_mob::Transport

pub trait Transport {
    type Filters: Debug;
    type Info: Debug;
    type Device: Exchange;

    // Required methods
    fn list<'life0, 'async_trait>(
        &'life0 mut self,
        filters: Self::Filters
    ) -> Pin<Box<dyn Future<Output = Result<Vec<LedgerInfo, Global>, Error>> + Send + 'async_trait, Global>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn connect<'life0, 'async_trait>(
        &'life0 mut self,
        info: Self::Info
    ) -> Pin<Box<dyn Future<Output = Result<Self::Device, Error>> + Send + 'async_trait, Global>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Transport trait provides an abstract interface for transport implementations

Required Associated Types§

type Filters: Debug

Connection filters

type Info: Debug

Device information, used for listing and connecting

type Device: Exchange

Device handle for interacting with the device

Required Methods§

fn list<'life0, 'async_trait>( &'life0 mut self, filters: Self::Filters ) -> Pin<Box<dyn Future<Output = Result<Vec<LedgerInfo, Global>, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

List available devices

fn connect<'life0, 'async_trait>( &'life0 mut self, info: Self::Info ) -> Pin<Box<dyn Future<Output = Result<Self::Device, Error>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Connect to a device using info from a previous list operation

Implementors§

§

impl Transport for LedgerProvider

Transport implementation for high-level LedgerProvider

§

impl Transport for BleTransport

Transport implementation for [BleTransport]

§

type Filters = ()

§

type Info = BleInfo

§

type Device = BleDevice

§

impl Transport for GenericTransport

§

type Filters = Filters

§

type Info = LedgerInfo

§

type Device = GenericDevice

§

impl Transport for TcpTransport

§

type Filters = ()

§

type Info = TcpInfo

§

type Device = TcpDevice

§

impl Transport for UsbTransport

§

type Filters = ()

§

type Info = UsbInfo

§

type Device = UsbDevice