pub struct DeviceEventCallbacks { /* private fields */ }Expand description
A structure holding the callbacks for device change notifications
Implementations§
Source§impl DeviceEventCallbacks
impl DeviceEventCallbacks
Sourcepub fn set_device_state_callback(
&mut self,
c: impl Fn(String, DeviceState) + 'static + Sync + Send,
)
pub fn set_device_state_callback( &mut self, c: impl Fn(String, DeviceState) + 'static + Sync + Send, )
Set a callback for OnDeviceStateChanged notifications. The parameters are the device id and the new state.
Sourcepub fn unset_device_state_callback(&mut self)
pub fn unset_device_state_callback(&mut self)
Remove a callback for OnDeviceStateChanged notifications
Sourcepub fn set_device_added_callback(
&mut self,
c: impl Fn(String) + 'static + Sync + Send,
)
pub fn set_device_added_callback( &mut self, c: impl Fn(String) + 'static + Sync + Send, )
Set a callback for OnDeviceAdded notifications. The parameter is the device id.
Sourcepub fn unset_device_added_callback(&mut self)
pub fn unset_device_added_callback(&mut self)
Remove a callback for OnDeviceAdded notifications
Sourcepub fn set_device_removed_callback(
&mut self,
c: impl Fn(String) + 'static + Sync + Send,
)
pub fn set_device_removed_callback( &mut self, c: impl Fn(String) + 'static + Sync + Send, )
Set a callback for OnDeviceRemoved notifications. The parameter is the device id.
Sourcepub fn unset_device_removed_callback(&mut self)
pub fn unset_device_removed_callback(&mut self)
Remove a callback for OnDeviceRemoved notifications
Sourcepub fn set_default_device_callback(
&mut self,
c: impl Fn(Direction, Role, Option<String>) + 'static + Sync + Send,
)
pub fn set_default_device_callback( &mut self, c: impl Fn(Direction, Role, Option<String>) + 'static + Sync + Send, )
Set a callback for OnDefaultDeviceChanged notifications. The parameters are the direction and role of the new default device, and its device id. The id is None when there is no longer a default device for that direction and role.
Sourcepub fn unset_default_device_callback(&mut self)
pub fn unset_default_device_callback(&mut self)
Remove a callback for OnDefaultDeviceChanged notifications
Sourcepub fn set_property_value_callback(
&mut self,
c: impl Fn(String, PROPERTYKEY) + 'static + Sync + Send,
)
pub fn set_property_value_callback( &mut self, c: impl Fn(String, PROPERTYKEY) + 'static + Sync + Send, )
Set a callback for OnPropertyValueChanged notifications. The parameters are the device id and the key of the changed property.
Sourcepub fn unset_property_value_callback(&mut self)
pub fn unset_property_value_callback(&mut self)
Remove a callback for OnPropertyValueChanged notifications