[−][src]Struct rumqtt::client::MqttClient
Handle to send requests and commands to the network eventloop
Methods
impl MqttClient
[src]
pub fn start(
opts: MqttOptions
) -> Result<(Self, Receiver<Notification>), ConnectError>
[src]
opts: MqttOptions
) -> Result<(Self, Receiver<Notification>), ConnectError>
Starts a new mqtt connection in a thread and returns [mqttclient] instance to send requests/commands to the event loop and a crossbeam channel receiver to receive notifications sent by the event loop.
See select.rs
example
[mqttclient]: struct.MqttClient.html
pub fn publish<S, V, B>(
&mut self,
topic: S,
qos: QoS,
retained: B,
payload: V
) -> Result<(), ClientError> where
S: Into<String>,
V: Into<Vec<u8>>,
B: Into<bool>,
[src]
&mut self,
topic: S,
qos: QoS,
retained: B,
payload: V
) -> Result<(), ClientError> where
S: Into<String>,
V: Into<Vec<u8>>,
B: Into<bool>,
Requests the eventloop for mqtt publish
pub fn subscribe<S>(&mut self, topic: S, qos: QoS) -> Result<(), ClientError> where
S: Into<String>,
[src]
S: Into<String>,
Requests the eventloop for mqtt subscribe
pub fn unsubscribe<S>(&mut self, topic: S) -> Result<(), ClientError> where
S: Into<String>,
[src]
S: Into<String>,
Requests the eventloop for mqtt unsubscribe
pub fn pause(&mut self) -> Result<(), ClientError>
[src]
Commands the network eventloop to disconnect from the broker. ReconnectOptions are not in affect here. Resume the network for reconnection
pub fn resume(&mut self) -> Result<(), ClientError>
[src]
Commands the network eventloop to reconnect to the broker and resume network io
pub fn shutdown(&mut self) -> Result<(), ClientError>
[src]
Commands the network eventloop to gracefully shutdown the connection to the broker.
Trait Implementations
impl Clone for MqttClient
[src]
fn clone(&self) -> MqttClient
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl Send for MqttClient
impl Unpin for MqttClient
impl Sync for MqttClient
impl !UnwindSafe for MqttClient
impl !RefUnwindSafe for MqttClient
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,