Struct rustable::Adapter[][src]

pub struct Adapter { /* fields omitted */ }

This struct represents a local Bluetooth adapter.

It can be used to query and configure the local adapter, get remote Devices, and host local GATT services.

Implementations

impl Adapter[src]

pub async fn from_conn(conn: Arc<RpcConn>, idx: u8) -> Result<Adapter, Error>[src]

Create an Adapter to interface with a specific Bluetooth adapter using an existing async_rustbus::RpcConn

pub async fn new(idx: u8) -> Result<Adapter, Error>[src]

Create an Adapter to interface with a specific Bluetooth adapter.

pub async fn addr(&self) -> Result<MAC, Error>[src]

Get the MAC of the local adapter.

pub async fn set_powered(&self, powered: bool) -> Result<(), Error>[src]

Turn the Bluetooth adapter on (true) or off.

pub async fn get_powered(&self) -> Result<bool, Error>[src]

Check if the device is powered on (true) or off.

pub fn path(&self) -> &ObjectPath[src]

Get the DBus ObjectPath of this remote device.

pub async fn get_devices(&self) -> Result<Vec<MAC>, Error>[src]

Get the MACs of remote devices that the adapter knows of.

This will included connected devices, paired devices, and visible devices (if discovery is enabled).

pub async fn get_device(&self, mac: MAC) -> Result<Device, Error>[src]

Get Device for the given MAC.

pub fn conn(&self) -> &Arc<RpcConn>[src]

Get a reference to Arc<async_rustbus::RpcConn> used to communicate with the Bluez daemon.

Auto Trait Implementations

impl !RefUnwindSafe for Adapter

impl Send for Adapter

impl Sync for Adapter

impl Unpin for Adapter

impl !UnwindSafe for Adapter

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.