Moved traits into seperate module

This commit is contained in:
2023-04-14 21:53:52 +02:00
parent b7329b58ee
commit 1a9d99fed9
14 changed files with 61 additions and 45 deletions

View File

@@ -1,6 +1,5 @@
use std::time::{SystemTime, UNIX_EPOCH};
use async_trait::async_trait;
use bytes::Bytes;
use serde::{Deserialize, Serialize};
use thiserror::Error;
@@ -10,13 +9,6 @@ use rumqttc::{Event, EventLoop, Incoming, Publish};
use crate::event::{self, EventChannel};
#[async_trait]
#[impl_cast::device_trait]
pub trait OnMqtt {
fn topics(&self) -> Vec<&str>;
async fn on_mqtt(&mut self, message: Publish);
}
#[derive(Debug, Error)]
pub enum ParseError {
#[error("Invalid message payload received: {0:?}")]