ledger_lib::transport

Trait Transport

Source
pub trait Transport {
    type Filters: Default + 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>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: '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>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Transport trait provides an abstract interface for transport implementations

Required Associated Types§

Source

type Filters: Default + Debug

Connection filters

Source

type Info: Debug

Device information, used for listing and connecting

Source

type Device: Exchange

Device handle for interacting with the device

Required Methods§

Source

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

List available devices

Source

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

Connect to a device using info from a previous list operation

Implementations on Foreign Types§

Source§

impl<T: Transport + Send> Transport for &mut T
where <T as Transport>::Device: Send, <T as Transport>::Filters: Send, <T as Transport>::Info: Send,

Blanket Transport implementation for references types

Source§

type Filters = <T as Transport>::Filters

Source§

type Info = <T as Transport>::Info

Source§

type Device = <T as Transport>::Device

Source§

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

Source§

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

Implementors§