pub struct MqttClientBuilder { /* private fields */ }
Implementations§
Source§impl MqttClientBuilder
impl MqttClientBuilder
pub fn new(url: Url) -> Self
pub fn client_id<S: Into<String>>(self, client_id: S) -> Self
Sourcepub fn clean_session(self, clean_session: bool) -> Self
pub fn clean_session(self, clean_session: bool) -> Self
When the clean session flag is set to true, the client does not want a persistent session. If the client disconnects for any reason, all information and messages that are queued from a previous persistent session are lost.
When the clean session flag is set to false, the broker creates a persistent session for the client. All information and messages are preserved until the next time that the client requests a clean session. If the clean session flag is set to false and the broker already has a session available for the client, it uses the existing session and delivers previously queued messages to the client.
pub fn subscribe<S: Into<String>>(self, filter: S, qos: QoS) -> Self
pub fn on_message_callback<F>(self, callback: F) -> Self
pub fn on_connected_callback<F>(self, callback: F) -> Self
pub fn on_message_owned_callback<F>(self, callback: F) -> Self
pub fn build(self) -> (MqttClient, MqttWorker)
Auto Trait Implementations§
impl Freeze for MqttClientBuilder
impl !RefUnwindSafe for MqttClientBuilder
impl Send for MqttClientBuilder
impl !Sync for MqttClientBuilder
impl Unpin for MqttClientBuilder
impl !UnwindSafe for MqttClientBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more