ewilken / hap-rs

Rust implementation of the Apple HomeKit Accessory Protocol (HAP)
Apache License 2.0
196 stars 33 forks source link

FnMut instead of Fn for on_update_async #67

Closed soundprojects closed 2 years ago

soundprojects commented 2 years ago

Is it possible for the on_update_async() function of characteristics to allow for functions that can change a variable outside of the function? I am currently trying to use these functions to change something when a characteristic changes but because it is Fn it doesn't allow me to 🙂

ewilken commented 2 years ago

Sure, good point, sounds worth looking into. Thanks for raising it! 🙂

Happy to accept a PR changing it if you feel like just changing it yourself. Otherwise I can look into it too.