Skip to main content

BluetoothSocketTrait

Trait BluetoothSocketTrait 

Source
pub trait BluetoothSocketTrait {
    // Required methods
    fn is_connected(&self) -> Result<bool, Error>;
    fn async_connect<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn sync_connect(&mut self) -> Result<(), Error>;

    // Provided methods
    fn supports_async(&mut self) -> Option<&mut dyn AsyncReadWrite> { ... }
    fn supports_sync(&mut self) -> Option<&mut dyn SyncReadWrite> { ... }
}
Expand description

The common functions for all bluetooth rfcomm sockets

Required Methods§

Source

fn is_connected(&self) -> Result<bool, Error>

Is the socket connected

Source

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

connect the socket

Source

fn sync_connect(&mut self) -> Result<(), Error>

connect the socket

Provided Methods§

Source

fn supports_async(&mut self) -> Option<&mut dyn AsyncReadWrite>

Does the socket support async?

Source

fn supports_sync(&mut self) -> Option<&mut dyn SyncReadWrite>

Does the socket support sync?

Implementors§