pub struct DeviceManager { /* private fields */ }
Expand description
A wrapper object providing device manager routines to a context.
Note: Saves a copy of active multi-use closure callbacks, which it frees on drop.
Implementations§
Source§impl DeviceManager
impl DeviceManager
Sourcepub fn test<F>(&mut self, callback: F) -> Operation<dyn FnMut(u32)>
pub fn test<F>(&mut self, callback: F) -> Operation<dyn FnMut(u32)>
Tests if this extension module is available in the server.
Panics if the underlying C function returns a null pointer.
Sourcepub fn read<F>(
&mut self,
callback: F,
) -> Operation<dyn FnMut(ListResult<&Info<'_>>)>
pub fn read<F>( &mut self, callback: F, ) -> Operation<dyn FnMut(ListResult<&Info<'_>>)>
Reads all entries from the device database.
Panics if the underlying C function returns a null pointer.
Sourcepub fn set_device_description<F>(
&mut self,
device: &str,
description: &str,
callback: F,
) -> Operation<dyn FnMut(bool)>
pub fn set_device_description<F>( &mut self, device: &str, description: &str, callback: F, ) -> Operation<dyn FnMut(bool)>
Sets the description for a device.
The callback must accept a bool
, which indicates success.
Panics if the underlying C function returns a null pointer.
Sourcepub fn delete<F>(
&mut self,
devices: &[&str],
callback: F,
) -> Operation<dyn FnMut(bool)>
pub fn delete<F>( &mut self, devices: &[&str], callback: F, ) -> Operation<dyn FnMut(bool)>
Deletes entries from the device database.
The callback must accept a bool
, which indicates success.
Panics if the underlying C function returns a null pointer.
Sourcepub fn enable_role_device_priority_routing<F>(
&mut self,
enable: bool,
callback: F,
) -> Operation<dyn FnMut(bool)>
pub fn enable_role_device_priority_routing<F>( &mut self, enable: bool, callback: F, ) -> Operation<dyn FnMut(bool)>
Enables the role-based device-priority routing mode.
The callback must accept a bool
, which indicates success.
Panics if the underlying C function returns a null pointer.
Sourcepub fn reorder_devices_for_role<F>(
&mut self,
role: &str,
devices: &[&str],
callback: F,
) -> Operation<dyn FnMut(bool)>
pub fn reorder_devices_for_role<F>( &mut self, role: &str, devices: &[&str], callback: F, ) -> Operation<dyn FnMut(bool)>
Reorders the position of a given device in the priority list to give preference to it.
The callback must accept a bool
, which indicates success.
Panics if the underlying C function returns a null pointer.
Sourcepub fn subscribe<F>(
&mut self,
enable: bool,
callback: F,
) -> Operation<dyn FnMut(bool)>
pub fn subscribe<F>( &mut self, enable: bool, callback: F, ) -> Operation<dyn FnMut(bool)>
Subscribes to changes in the device database.
The callback must accept a bool
, which indicates success.
Panics if the underlying C function returns a null pointer.
Sourcepub fn set_subscribe_cb<F>(&mut self, callback: F)where
F: FnMut() + 'static,
pub fn set_subscribe_cb<F>(&mut self, callback: F)where
F: FnMut() + 'static,
Sets the subscription callback that is called when subscribe()
was
called.