pub struct MqttConnection { /* private fields */ }Expand description
Manages a MQTT connection.
Implementations§
Source§impl MqttConnection
impl MqttConnection
Sourcepub fn new(opts: MqttConnectionOptions) -> Result<MqttConnection, String>
pub fn new(opts: MqttConnectionOptions) -> Result<MqttConnection, String>
Create a connection instance.
Trait Implementations§
Source§impl Clone for MqttConnection
impl Clone for MqttConnection
Source§fn clone(&self) -> MqttConnection
fn clone(&self) -> MqttConnection
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl GmqConnection for MqttConnection
impl GmqConnection for MqttConnection
Source§fn add_handler(&mut self, handler: Arc<dyn EventHandler>) -> String
fn add_handler(&mut self, handler: Arc<dyn EventHandler>) -> String
To add a connection event handler. This will return an identifier for applications to manage
handlers.
Source§fn remove_handler(&mut self, id: &str)
fn remove_handler(&mut self, id: &str)
To remove a handler with an idenfier from
GmqConnection::add_handler.Auto Trait Implementations§
impl Freeze for MqttConnection
impl RefUnwindSafe for MqttConnection
impl Send for MqttConnection
impl Sync for MqttConnection
impl Unpin for MqttConnection
impl UnwindSafe for MqttConnection
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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