[][src]Struct actix_mqtt_client::MqttClient

pub struct MqttClient { /* fields omitted */ }

The client for connecting to the MQTT server

Methods

impl MqttClient[src]

pub fn new<TReader: AsyncRead + Send + 'static, TWriter: Write + Send + 'static>(
    reader: TReader,
    writer: TWriter,
    client_name: String,
    options: MqttOptions,
    message_recipient: Recipient<PublishMessage>,
    error_recipient: Recipient<ErrorMessage>
) -> Self
[src]

Create a new MQTT client

pub fn name(&self) -> &str[src]

Returns the name of the client

pub fn connect(&mut self) -> Box<dyn Future<Item = (), Error = IoError>>[src]

Perform the connect operation to the remote MQTT server

Note: This function can only be called once for each client, calling it the second time will return an error

pub fn subscribe(
    &self,
    topic: String,
    qos: QualityOfService
) -> Box<dyn Future<Item = (), Error = IoError>>
[src]

Subscribe to the server with a topic and QoS

pub fn unsubscribe(
    &self,
    topic: String
) -> Box<dyn Future<Item = (), Error = IoError>>
[src]

Unsubscribe from the server

pub fn publish(
    &self,
    topic: String,
    qos: QualityOfService,
    payload: Vec<u8>
) -> Box<dyn Future<Item = (), Error = IoError>>
[src]

Publish a message

pub fn disconnect(&self) -> Box<dyn Future<Item = (), Error = IoError>>[src]

Disconnect from the server

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

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T, U> Into<U> for T where
    U: From<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

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,