next_web_mqtt/lib.rs
1
2/// 关于MQTT协议的 相关实现
3///
4/// 其中包含
5/// 1. 连接服务所使用的选项 https://
6/// 2. 每个 Topic 的实现消费者
7/// 3. 当消息进入 Service 前的拦截处理
8///
9///
10/// # Examples
11///
12/// ```
13/// use rudi_dev::Singleton;
14/// use next_web_core::async_trait;
15///
16/// #[SingleOwner(binds = [Self::into_base_topic])]
17/// #[derive(Clone)]
18/// pub struct TestBaseTopic;
19///
20///
21/// #[async_trait]
22/// impl BaseTopic for TestBaseTopic {
23///
24/// fn topic(&slef) -> &'static str
25/// {
26/// "test/#"
27/// }
28///
29/// async fn consume(&mut self, topic: &str, message: &[u8])
30/// {
31/// println!("接受到消息, 消息 Topic: {}, 数据内容: {:?}", topic, String::from_utf8_lossy(message));
32/// }
33/// }
34///
35/// impl BaseTopic {
36///
37/// fn into_base_topic(self) -> Box<dyn BaseTopic>
38/// {
39/// Box::new(self)
40/// }
41/// }
42/// ```
43///
44
45pub mod core;
46pub mod auto_register;
47pub mod properties;
48pub mod service;