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]] [[package]]
name = "mqttclient" name = "mqtt-client"
version = "0.1.0" version = "1.0.0"
dependencies = [ dependencies = [
"crossbeam", "crossbeam",
"rumqttc", "rumqttc",

View File

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

View File

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