DMSCProtocolConnection

Trait DMSCProtocolConnection 

Source
pub trait DMSCProtocolConnection {
    // Required methods
    fn connection_id(&self) -> &str;
    fn remote_device_id(&self) -> &str;
    fn protocol_type(&self) -> DMSCProtocolType;
    fn is_active(&self) -> bool;
    fn send<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        data: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = DMSCResult<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn receive<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        buffer: &'life1 mut [u8],
    ) -> Pin<Box<dyn Future<Output = DMSCResult<usize>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_stats(&self) -> DMSCConnectionStats;
    fn close<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = DMSCResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Protocol connection trait

Required Methods§

Source

fn connection_id(&self) -> &str

Get connection ID

Source

fn remote_device_id(&self) -> &str

Get remote device ID

Source

fn protocol_type(&self) -> DMSCProtocolType

Get protocol type

Source

fn is_active(&self) -> bool

Check if connection is active

Source

fn send<'life0, 'life1, 'async_trait>( &'life0 mut self, data: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = DMSCResult<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send data

Source

fn receive<'life0, 'life1, 'async_trait>( &'life0 mut self, buffer: &'life1 mut [u8], ) -> Pin<Box<dyn Future<Output = DMSCResult<usize>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Receive data

Source

fn get_stats(&self) -> DMSCConnectionStats

Get statistics

Source

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

Close connection

Implementors§