-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dadab8a
commit 721c322
Showing
6 changed files
with
36 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,18 @@ | ||
pub mod boolean; | ||
mod core_members; | ||
pub mod attribute; | ||
mod dispatcher; | ||
|
||
use async_trait::async_trait; | ||
use bytes::Bytes; | ||
|
||
pub use core_members::MessageCoreMembers; | ||
pub use dispatcher::MessageDispatcher; | ||
|
||
pub use super::AttributeBuilder; | ||
|
||
pub type MessageClient = rumqttc::AsyncClient; | ||
|
||
pub type AttributeId = u32; | ||
|
||
/// Trait to manage an message attribute (MQTT) | ||
/// Sync version | ||
#[async_trait] | ||
pub trait OnMessageHandler: Send + Sync { | ||
async fn on_message(&mut self, data: &Bytes); | ||
} | ||
|
||
#[async_trait] | ||
pub trait OnBooleanMessage: Send + Sync { | ||
async fn on_message_boolean(&mut self, id: AttributeId, data: bool); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters