fix accesability

This commit is contained in:
Laila van Reenen 2025-01-25 20:37:29 +01:00
parent 2d2b0026ad
commit f0b3431145
Signed by: LailaTheElf
GPG Key ID: 8A3EF0226518C12D
3 changed files with 9 additions and 9 deletions

4
Cargo.lock generated
View File

@ -245,8 +245,8 @@ dependencies = [
]
[[package]]
name = "mqttclient"
version = "0.1.0"
name = "mqtt-client"
version = "1.0.0"
dependencies = [
"crossbeam",
"rumqttc",

View File

@ -1,6 +1,6 @@
[package]
name = "mqttclient"
version = "0.1.0"
name = "mqtt-client"
version = "1.0.0"
edition = "2021"
[dependencies]

View File

@ -1,5 +1,5 @@
mod mqtt_client {
pub mod mqtt_client {
use std::time::Duration;
use std::thread;
@ -8,12 +8,12 @@ mod mqtt_client {
pub trait MqttTool {
fn new(client: Client, tx: Sender<MqttMessage>) -> Self;
fn rx(&self, messaage: MqttMessage);
fn rx(&mut self, messaage: MqttMessage);
}
pub struct MqttMessage {
topic: String,
payload: String
pub topic: String,
pub payload: String
}
pub fn run<T: MqttTool>(host: String, port: u16, client: String, user: String, pass: String) {
@ -69,7 +69,7 @@ mod mqtt_client {
}
}
pub(self) fn handeler<T: MqttTool>(mut connection: Connection, tool: T) {
pub(self) fn handeler<T: MqttTool>(mut connection: Connection, mut tool: T) {
for (_i, notification) in connection.iter().enumerate() {
let mut delay: bool = false;
match notification {