spotflow 0.8.1

Device SDK for Spotflow IoT Platform
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use async_trait::async_trait;
use rumqttc::Publish;

pub(super) mod c2d;
pub(super) mod direct_method;
pub(super) mod twins;

pub(super) trait Handler {
    fn prefix(&self) -> Vec<&str>;
    fn handle(&mut self, publish: &Publish);
}

#[async_trait]
pub(super) trait AsyncHandler {
    fn prefix(&self) -> Vec<&str>;
    async fn handle(&mut self, publish: &Publish);
}