ConnectionTrait

Trait ConnectionTrait 

Source
pub trait ConnectionTrait: Send + Sync {
    // Required methods
    fn send<'life0, 'life1, 'async_trait>(
        &'life0 self,
        data: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn receive<'life0, 'async_trait>(
        &'life0 self,
        timeout: Duration,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn is_reliable(&self) -> bool { ... }
}
Expand description

Transport-agnostic connection: send and receive raw Matter messages.

Implement this for UDP (Connection) and BTP ([crate::btp::BtpConnection]).

Required Methods§

Source

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

Source

fn receive<'life0, 'async_trait>( &'life0 self, timeout: Duration, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn is_reliable(&self) -> bool

True for transports (BTP) that guarantee delivery so Matter-layer MRP retransmit should be suppressed. Default: false (UDP).

Implementors§