rs-zero 0.2.18

Rust-first microservice framework inspired by go-zero engineering practices
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::mqtt::MqttPublisher;

#[derive(Debug, Clone)]
pub struct MqttContext {
    publisher: MqttPublisher,
}

impl MqttContext {
    pub fn new(publisher: MqttPublisher) -> Self {
        Self { publisher }
    }

    pub fn publisher(&self) -> &MqttPublisher {
        &self.publisher
    }
}