pub struct DeviceHub { /* private fields */ }
Expand description
A type representing a hub for devices to connect to.
The device hub is a type used for waiting on a device connection or to check if a device is still connected.
Implementations§
Source§impl DeviceHub
impl DeviceHub
Sourcepub fn wait_for_device(&self) -> Result<Device>
pub fn wait_for_device(&self) -> Result<Device>
Gets a connected device, or waits for any device to be connected.
If any device is connected, this method will return that device. It will cycle through devices if multiple are connected. Otherwise, it blocks the calling thread until a device is connected.
§Errors
Returns CouldNotWaitForDeviceError
if an internal exception occurs while trying to wait
for device connections.
Returns DeviceConstructionError
if a device is
found but an exception occurs during type construction.
Sourcepub fn is_device_connected(&self, device: &Device) -> bool
pub fn is_device_connected(&self, device: &Device) -> bool
Predicate to check whether a given device is connected.
Trait Implementations§
Source§impl From<NonNull<rs2_device_hub>> for DeviceHub
impl From<NonNull<rs2_device_hub>> for DeviceHub
Source§fn from(devicehub_ptr: NonNull<rs2_device_hub>) -> Self
fn from(devicehub_ptr: NonNull<rs2_device_hub>) -> Self
Converts to this type from the input type.
impl Send for DeviceHub
Auto Trait Implementations§
impl Freeze for DeviceHub
impl RefUnwindSafe for DeviceHub
impl !Sync for DeviceHub
impl Unpin for DeviceHub
impl UnwindSafe for DeviceHub
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