[][src]Struct paho_mqtt::topic::Topic

pub struct Topic<'a> { /* fields omitted */ }

A topic destination for messages. This keeps message parameters for repeatedly publishing to the same topic on a server.

Methods

impl<'a> Topic<'a>[src]

pub fn new<T>(cli: &'a AsyncClient, topic: T, qos: i32) -> Topic<'a> where
    T: Into<String>, 
[src]

Creates a new topic object for publishing messages.

Arguments

cli The client used to publish the messages. topic The topic on which to publish the messages qos The quality of service for messages

pub fn new_retained<T>(cli: &'a AsyncClient, topic: T, qos: i32) -> Topic<'a> where
    T: Into<String>, 
[src]

Creates a new topic object for publishing messages.

Arguments

cli The client used to publish the messages. topic The topic on which to publish the messages qos The quality of service for messages

pub fn subscribe(&self) -> Token[src]

Subscribe to the topic.

pub fn subscribe_with_options<T>(&self, opts: T) -> Token where
    T: Into<SubscribeOptions>, 
[src]

Subscribe to the topic with subscription options.

pub fn publish<V>(&self, payload: V) -> DeliveryToken where
    V: Into<Vec<u8>>, 
[src]

Publish a message on the topic.

Arguments

payload The payload of the message

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Topic<'a>

impl<'a> Send for Topic<'a>

impl<'a> Sync for Topic<'a>

impl<'a> Unpin for Topic<'a>

impl<'a> !UnwindSafe for Topic<'a>

Blanket Implementations

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

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

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

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.