Trait autd3_driver::link::Link

source ·
pub trait Link: Send + Sync {
    // Required methods
    fn close<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<(), AUTDInternalError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn send<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        tx: &'life1 TxDatagram
    ) -> Pin<Box<dyn Future<Output = Result<bool, AUTDInternalError>> + 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<bool, AUTDInternalError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn is_open(&self) -> bool;
    fn timeout(&self) -> Duration;

    // Provided methods
    fn send_receive<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        tx: &'life1 TxDatagram,
        rx: &'life2 mut [RxMessage],
        timeout: Option<Duration>
    ) -> Pin<Box<dyn Future<Output = Result<bool, AUTDInternalError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn wait_msg_processed<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        tx: &'life1 TxDatagram,
        rx: &'life2 mut [RxMessage],
        timeout: Duration
    ) -> Pin<Box<dyn Future<Output = Result<bool, AUTDInternalError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}
Expand description

Link is a interface to the AUTD device

Required Methods§

source

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

Close link

source

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

Send data to devices

source

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

Receive data from devices

source

fn is_open(&self) -> bool

Check if link is open

source

fn timeout(&self) -> Duration

Get timeout

Provided Methods§

source

fn send_receive<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, tx: &'life1 TxDatagram, rx: &'life2 mut [RxMessage], timeout: Option<Duration> ) -> Pin<Box<dyn Future<Output = Result<bool, AUTDInternalError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Send and receive data

source

fn wait_msg_processed<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, tx: &'life1 TxDatagram, rx: &'life2 mut [RxMessage], timeout: Duration ) -> Pin<Box<dyn Future<Output = Result<bool, AUTDInternalError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Wait until message is processed

Implementors§