Rewrote impl_cast as a proc_macro to make it easier to work with

This commit is contained in:
2023-04-12 01:17:06 +02:00
parent b54c9512b9
commit ca8821b406
10 changed files with 243 additions and 121 deletions

View File

@@ -10,7 +10,8 @@ use rumqttc::{Event, EventLoop, Incoming, Publish};
use tokio::sync::broadcast;
#[async_trait]
pub trait OnMqtt: Sync + Send + 'static {
#[impl_cast::device_trait]
pub trait OnMqtt {
async fn on_mqtt(&mut self, message: &Publish);
}