pub struct Device<'a> { /* private fields */ }
Implementations§
Source§impl Device<'_>
impl Device<'_>
Sourcepub fn provides(&self, feature: Feature) -> bool
pub fn provides(&self, feature: Feature) -> bool
Returns the list of features supported by the device.
pub fn identifier(&self) -> &str
pub fn name(&self) -> &str
Sourcepub fn is_server(&self) -> bool
pub fn is_server(&self) -> bool
Syntax sugar method for checking if the current device provides Feature::Server
Sourcepub fn is_controller(&self) -> bool
pub fn is_controller(&self) -> bool
Syntax sugar method for checking if the current device provides Feature::Controller
Sourcepub fn access_token(&self) -> Option<&str>
pub fn access_token(&self) -> Option<&str>
Returns the authentication token that should be used when connecting to the device. If it’s a shared device, the main authentication token will no be accepted.
Sourcepub async fn connect(&self) -> Result<DeviceConnection>
pub async fn connect(&self) -> Result<DeviceConnection>
Connect to the device.
Sourcepub async fn connect_via(&self, server: &Server) -> Result<DeviceConnection>
pub async fn connect_via(&self, server: &Server) -> Result<DeviceConnection>
Establish a connection to the device using server as a proxy.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Device<'a>
impl<'a> !RefUnwindSafe for Device<'a>
impl<'a> Send for Device<'a>
impl<'a> Sync for Device<'a>
impl<'a> Unpin for Device<'a>
impl<'a> !UnwindSafe for Device<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more