Trait AsyncLink

Source
pub trait AsyncLink: Send {
    // Required methods
    fn open<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        geometry: &'life1 Geometry,
    ) -> Pin<Box<dyn Future<Output = Result<(), LinkError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn close<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), LinkError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn send<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        tx: &'life1 [TxMessage],
    ) -> Pin<Box<dyn Future<Output = Result<(), LinkError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn receive<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        rx: &'life1 mut [RxMessage],
    ) -> Pin<Box<dyn Future<Output = Result<(), LinkError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn is_open(&self) -> bool;
}
Available on crate features async and link only.
Expand description

A trait that provides the interface with the device.

Required Methods§

Source

fn open<'life0, 'life1, 'async_trait>( &'life0 mut self, geometry: &'life1 Geometry, ) -> Pin<Box<dyn Future<Output = Result<(), LinkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Opens the link.

Source

fn close<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), LinkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Closes the link.

Source

fn send<'life0, 'life1, 'async_trait>( &'life0 mut self, tx: &'life1 [TxMessage], ) -> Pin<Box<dyn Future<Output = Result<(), LinkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sends a message to the device.

Source

fn receive<'life0, 'life1, 'async_trait>( &'life0 mut self, rx: &'life1 mut [RxMessage], ) -> Pin<Box<dyn Future<Output = Result<(), LinkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Receives a message from the device.

Source

fn is_open(&self) -> bool

Checks if the link is open.

Trait Implementations§

Source§

fn open<'life0, 'life1, 'async_trait>( &'life0 mut self, geometry: &'life1 Geometry, ) -> Pin<Box<dyn Future<Output = Result<(), LinkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Opens the link.
Source§

fn close<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), LinkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Closes the link.
Source§

fn send<'life0, 'life1, 'async_trait>( &'life0 mut self, tx: &'life1 [TxMessage], ) -> Pin<Box<dyn Future<Output = Result<(), LinkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sends a message to the device.
Source§

fn receive<'life0, 'life1, 'async_trait>( &'life0 mut self, rx: &'life1 mut [RxMessage], ) -> Pin<Box<dyn Future<Output = Result<(), LinkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Receives a message from the device.
Source§

fn is_open(&self) -> bool

Checks if the link is open.

Implementations on Foreign Types§

Source§

fn open<'life0, 'life1, 'async_trait>( &'life0 mut self, geometry: &'life1 Geometry, ) -> Pin<Box<dyn Future<Output = Result<(), LinkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn close<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), LinkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn send<'life0, 'life1, 'async_trait>( &'life0 mut self, tx: &'life1 [TxMessage], ) -> Pin<Box<dyn Future<Output = Result<(), LinkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn receive<'life0, 'life1, 'async_trait>( &'life0 mut self, rx: &'life1 mut [RxMessage], ) -> Pin<Box<dyn Future<Output = Result<(), LinkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn is_open(&self) -> bool

Implementors§