diff options
author | Marcel Müller <neikos@neikos.email> | 2024-04-05 11:45:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-05 11:45:58 +0200 |
commit | 16dd1fe3465fbb90e640975b5aa6de0541d42090 (patch) | |
tree | c316ab04d1a28c236524d87371002018338ff592 /src/client/mod.rs | |
parent | c1dd330208fdc4899e9f655cc9d8a308bfc20a32 (diff) | |
parent | cb21213d2167f9dab759ea0d6ecddd8d4ef5262d (diff) |
Merge pull request #280 from matthiasbeyer/client-builder
Client builder
Diffstat (limited to 'src/client/mod.rs')
-rw-r--r-- | src/client/mod.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/client/mod.rs b/src/client/mod.rs index 72780b3..8ff460f 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -4,6 +4,7 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/. // +pub mod builder; pub mod connect; mod receive; pub mod send; @@ -36,14 +37,15 @@ impl MqttClient { inner: Arc::new(Mutex::new(InnerClient { connection_state: None, session_state: None, - default_handlers: ClientHandlers { - on_packet_recv: Box::new(|_| ()), - handle_acknowledge: Box::new(|_| Acknowledge::Yes), - }, + default_handlers: ClientHandlers::default(), outstanding_callbacks: Callbacks::new(), })), } } + + pub fn builder() -> builder::MqttClientBuilder { + builder::MqttClientBuilder::new() + } } #[cfg(test)] |