Make update callback send and sync
This commit is contained in:
parent
bd99facbf4
commit
5e996cd47d
1 changed files with 2 additions and 2 deletions
|
@ -38,7 +38,7 @@ pub struct Device {
|
||||||
sub_type: u16,
|
sub_type: u16,
|
||||||
device_protocol_version: u8,
|
device_protocol_version: u8,
|
||||||
|
|
||||||
updates: Vec<Box<dyn Fn(&HashMap<&'static str, AttributeValue>) -> Result<()>>>,
|
updates: Vec<Box<dyn Fn(&HashMap<&'static str, AttributeValue>) -> Result<()> + Send + Sync>>,
|
||||||
|
|
||||||
token: [u8; 64],
|
token: [u8; 64],
|
||||||
key: [u8; 32],
|
key: [u8; 32],
|
||||||
|
@ -153,7 +153,7 @@ impl Device {
|
||||||
|
|
||||||
pub fn register_update<F>(mut self, f: F) -> Self
|
pub fn register_update<F>(mut self, f: F) -> Self
|
||||||
where
|
where
|
||||||
F: Fn(&HashMap<&'static str, AttributeValue>) -> Result<()> + 'static,
|
F: Fn(&HashMap<&'static str, AttributeValue>) -> Result<()> + Send + Sync + 'static,
|
||||||
{
|
{
|
||||||
self.updates.push(Box::new(f));
|
self.updates.push(Box::new(f));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue