[−][src]Struct mijia::bluetooth::BluetoothSession
A connection to the Bluetooth daemon. This can be cheaply cloned and passed around to be used from different places.
Fields
connection: Arc<SyncConnection>
Implementations
impl BluetoothSession
[src]
pub async fn new(
) -> Result<(impl Future<Output = Result<(), SpawnError>>, Self), BluetoothError>
[src]
) -> Result<(impl Future<Output = Result<(), SpawnError>>, Self), BluetoothError>
Returns a tuple of (join handle, Self). If the join handle ever completes then you're in trouble and should probably restart the process.
pub async fn start_discovery<'_>(&'_ self) -> Result<(), BluetoothError>
[src]
Power on all Bluetooth adapters and start scanning for devices.
pub async fn get_devices<'_>(
&'_ self
) -> Result<Vec<DeviceInfo>, BluetoothError>
[src]
&'_ self
) -> Result<Vec<DeviceInfo>, BluetoothError>
Get a list of all Bluetooth devices which have been discovered so far.
pub async fn connect<'_, '_>(
&'_ self,
id: &'_ DeviceId
) -> Result<(), BluetoothError>
[src]
&'_ self,
id: &'_ DeviceId
) -> Result<(), BluetoothError>
Connect to the Bluetooth device with the given D-Bus object path.
pub async fn disconnect<'_, '_>(
&'_ self,
id: &'_ DeviceId
) -> Result<(), BluetoothError>
[src]
&'_ self,
id: &'_ DeviceId
) -> Result<(), BluetoothError>
Disconnect from the Bluetooth device with the given D-Bus object path.
Trait Implementations
impl Clone for BluetoothSession
[src]
pub fn clone(&self) -> BluetoothSession
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for BluetoothSession
[src]
Auto Trait Implementations
impl !RefUnwindSafe for BluetoothSession
[src]
impl Send for BluetoothSession
[src]
impl Sync for BluetoothSession
[src]
impl Unpin for BluetoothSession
[src]
impl !UnwindSafe for BluetoothSession
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,