[][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 disconnect(&mut self) -> Result<(), ClientError>
[src]

Requests the event loop for disconnection

Trait Implementations

impl Clone for MqttClient
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for MqttClient

impl Sync for MqttClient

Blanket Implementations

impl<T> From for T
[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T> Erased for T