[][src]Struct rumqtt::client::MqttClient

pub struct MqttClient { /* fields omitted */ }

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]

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]

Requests the eventloop for mqtt publish

pub fn subscribe<S>(&mut self, topic: S, qos: QoS) -> Result<(), ClientError> where
    S: Into<String>, 
[src]

Requests the eventloop for mqtt subscribe

pub fn unsubscribe<S>(&mut self, topic: S) -> Result<(), ClientError> where
    S: Into<String>, 
[src]

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]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T