pub struct AsyncClient { /* private fields */ }Expand description
Implementations§
Source§impl AsyncClient
impl AsyncClient
Sourcepub fn new(options: MqttOptions, cap: usize) -> (AsyncClient, EventLoop)
pub fn new(options: MqttOptions, cap: usize) -> (AsyncClient, EventLoop)
Create a new AsyncClient.
cap specifies the capacity of the bounded async channel.
Sourcepub fn from_senders(request_tx: Sender<Request>) -> AsyncClient
pub fn from_senders(request_tx: Sender<Request>) -> AsyncClient
Create a new AsyncClient from a channel Sender.
This is mostly useful for creating a test instance where you can listen on the corresponding receiver.
pub async fn publish_with_properties<S, P>( &self, topic: S, qos: QoS, retain: bool, payload: P, properties: PublishProperties, ) -> Result<Token<AckOfPub>, ClientError>
pub async fn publish<S, P>( &self, topic: S, qos: QoS, retain: bool, payload: P, ) -> Result<Token<AckOfPub>, ClientError>
pub fn try_publish_with_properties<S, P>( &self, topic: S, qos: QoS, retain: bool, payload: P, properties: PublishProperties, ) -> Result<Token<AckOfPub>, ClientError>
pub fn try_publish<S, P>( &self, topic: S, qos: QoS, retain: bool, payload: P, ) -> Result<Token<AckOfPub>, ClientError>
Sourcepub async fn ack(
&self,
publish: &Publish,
) -> Result<Token<AckOfAck>, ClientError>
pub async fn ack( &self, publish: &Publish, ) -> Result<Token<AckOfAck>, ClientError>
Sends a MQTT PubAck to the EventLoop. Only needed in if manual_acks flag is set.
Sourcepub fn try_ack(&self, publish: &Publish) -> Result<Token<AckOfAck>, ClientError>
pub fn try_ack(&self, publish: &Publish) -> Result<Token<AckOfAck>, ClientError>
Attempts to send a MQTT PubAck to the EventLoop. Only needed in if manual_acks flag is set.
pub async fn publish_bytes_with_properties<S>( &self, topic: S, qos: QoS, retain: bool, payload: Bytes, properties: PublishProperties, ) -> Result<Token<AckOfPub>, ClientError>
pub async fn publish_bytes<S>( &self, topic: S, qos: QoS, retain: bool, payload: Bytes, ) -> Result<Token<AckOfPub>, ClientError>
pub async fn subscribe_with_properties<S: Into<String>>( &self, topic: S, qos: QoS, properties: SubscribeProperties, ) -> Result<Token<SubAck>, ClientError>
pub async fn subscribe<S: Into<String>>( &self, topic: S, qos: QoS, ) -> Result<Token<SubAck>, ClientError>
pub fn try_subscribe_with_properties<S: Into<String>>( &self, topic: S, qos: QoS, properties: SubscribeProperties, ) -> Result<Token<SubAck>, ClientError>
pub fn try_subscribe<S: Into<String>>( &self, topic: S, qos: QoS, ) -> Result<Token<SubAck>, ClientError>
pub async fn subscribe_many_with_properties<T>(
&self,
topics: T,
properties: SubscribeProperties,
) -> Result<Token<SubAck>, ClientError>where
T: IntoIterator<Item = Filter>,
pub async fn subscribe_many<T>(
&self,
topics: T,
) -> Result<Token<SubAck>, ClientError>where
T: IntoIterator<Item = Filter>,
pub fn try_subscribe_many_with_properties<T>(
&self,
topics: T,
properties: SubscribeProperties,
) -> Result<Token<SubAck>, ClientError>where
T: IntoIterator<Item = Filter>,
pub fn try_subscribe_many<T>(
&self,
topics: T,
) -> Result<Token<SubAck>, ClientError>where
T: IntoIterator<Item = Filter>,
pub async fn unsubscribe_with_properties<S: Into<String>>( &self, topic: S, properties: UnsubscribeProperties, ) -> Result<Token<UnsubAck>, ClientError>
pub async fn unsubscribe<S: Into<String>>( &self, topic: S, ) -> Result<Token<UnsubAck>, ClientError>
pub fn try_unsubscribe_with_properties<S: Into<String>>( &self, topic: S, properties: UnsubscribeProperties, ) -> Result<Token<UnsubAck>, ClientError>
pub fn try_unsubscribe<S: Into<String>>( &self, topic: S, ) -> Result<Token<UnsubAck>, ClientError>
Sourcepub async fn disconnect(&self) -> Result<Token<()>, ClientError>
pub async fn disconnect(&self) -> Result<Token<()>, ClientError>
Sends a MQTT disconnect to the EventLoop
Sourcepub fn try_disconnect(&self) -> Result<Token<()>, ClientError>
pub fn try_disconnect(&self) -> Result<Token<()>, ClientError>
Attempts to send a MQTT disconnect to the EventLoop
Trait Implementations§
Source§impl Clone for AsyncClient
impl Clone for AsyncClient
Source§fn clone(&self) -> AsyncClient
fn clone(&self) -> AsyncClient
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AsyncClient
impl RefUnwindSafe for AsyncClient
impl Send for AsyncClient
impl Sync for AsyncClient
impl Unpin for AsyncClient
impl UnwindSafe for AsyncClient
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)