Transport

Trait Transport 

Source
pub trait Transport {
    type Filters: Default + Debug;
    type Info: Debug;
    type Device: NonSendExchange;

    // Required methods
    async fn list(
        &mut self,
        filters: Self::Filters,
    ) -> Result<Vec<LedgerInfo>, Error>;
    async fn connect(&mut self, info: Self::Info) -> Result<Self::Device, Error>;
}
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: NonSendExchange

Device handle for interacting with the device

Required Methods§

Source

async fn list( &mut self, filters: Self::Filters, ) -> Result<Vec<LedgerInfo>, Error>

List available devices

Source

async fn connect(&mut self, info: Self::Info) -> Result<Self::Device, Error>

Connect to a device using info from a previous list operation

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.

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§

async fn list( &mut self, filters: Self::Filters, ) -> Result<Vec<LedgerInfo>, Error>

Source§

async fn connect(&mut self, info: Self::Info) -> Result<Self::Device, Error>

Implementors§