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§
Sourcefn is_connected(&self) -> Result<bool, Error>
fn is_connected(&self) -> Result<bool, Error>
Is the socket connected
Sourcefn 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 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
Sourcefn sync_connect(&mut self) -> Result<(), Error>
fn sync_connect(&mut self) -> Result<(), Error>
connect the socket
Provided Methods§
Sourcefn supports_async(&mut self) -> Option<&mut dyn AsyncReadWrite>
fn supports_async(&mut self) -> Option<&mut dyn AsyncReadWrite>
Does the socket support async?
Sourcefn supports_sync(&mut self) -> Option<&mut dyn SyncReadWrite>
fn supports_sync(&mut self) -> Option<&mut dyn SyncReadWrite>
Does the socket support sync?