Struct rumqttc_async_std::AsyncClient [−][src]
AsyncClient
to communicate with MQTT Eventloop
This is cloneable and can be used to asynchronously Publish, Subscribe.
Implementations
impl AsyncClient
[src]
pub fn new(options: MqttOptions, cap: usize) -> (AsyncClient, EventLoop)
[src]
Create a new AsyncClient
pub fn from_senders(
request_tx: Sender<Request>,
cancel_tx: Sender<()>
) -> AsyncClient
[src]
request_tx: Sender<Request>,
cancel_tx: Sender<()>
) -> AsyncClient
Create a new AsyncClient
from a pair of async channel Sender
s. This is mostly useful for
creating a test instance.
pub async fn publish<S, V>(
&self,
topic: S,
qos: QoS,
retain: bool,
payload: V
) -> Result<(), ClientError> where
S: Into<String>,
V: Into<Vec<u8>>,
[src]
&self,
topic: S,
qos: QoS,
retain: bool,
payload: V
) -> Result<(), ClientError> where
S: Into<String>,
V: Into<Vec<u8>>,
Sends a MQTT Publish to the eventloop
pub fn try_publish<S, V>(
&self,
topic: S,
qos: QoS,
retain: bool,
payload: V
) -> Result<(), ClientError> where
S: Into<String>,
V: Into<Vec<u8>>,
[src]
&self,
topic: S,
qos: QoS,
retain: bool,
payload: V
) -> Result<(), ClientError> where
S: Into<String>,
V: Into<Vec<u8>>,
Sends a MQTT Publish to the eventloop
pub async fn publish_bytes<S>(
&self,
topic: S,
qos: QoS,
retain: bool,
payload: Bytes
) -> Result<(), ClientError> where
S: Into<String>,
[src]
&self,
topic: S,
qos: QoS,
retain: bool,
payload: Bytes
) -> Result<(), ClientError> where
S: Into<String>,
Sends a MQTT Publish to the eventloop
pub async fn subscribe<S: Into<String>>(
&self,
topic: S,
qos: QoS
) -> Result<(), ClientError>
[src]
&self,
topic: S,
qos: QoS
) -> Result<(), ClientError>
Sends a MQTT Subscribe to the eventloop
pub async fn subscribe_many<T>(&mut self, topics: T) -> Result<(), ClientError> where
T: IntoIterator<Item = SubscribeFilter>,
[src]
T: IntoIterator<Item = SubscribeFilter>,
Sends a MQTT Subscribe for multiple topics to the eventloop
pub async fn unsubscribe<S: Into<String>>(
&self,
topic: S
) -> Result<(), ClientError>
[src]
&self,
topic: S
) -> Result<(), ClientError>
Sends a MQTT Unsubscribe to the eventloop
pub async fn disconnect(&self) -> Result<(), ClientError>
[src]
Sends a MQTT disconnect to the eventloop
pub async fn cancel(&self) -> Result<(), ClientError>
[src]
Stops the eventloop right away
Trait Implementations
impl Clone for AsyncClient
[src]
fn clone(&self) -> AsyncClient
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for AsyncClient
[src]
Auto Trait Implementations
impl RefUnwindSafe for AsyncClient
[src]
impl Send for AsyncClient
[src]
impl Sync for AsyncClient
[src]
impl Unpin for AsyncClient
[src]
impl UnwindSafe for AsyncClient
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut 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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,