azure_iot_operations_mqtt::interface

Trait PubReceiver

Source
pub trait PubReceiver {
    // Required methods
    fn recv<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Option<Publish>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn recv_manual_ack<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Option<(Publish, Option<AckToken>)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn close(&mut self);
}
Expand description

Receiver for incoming MQTT messages.

Required Methods§

Source

fn recv<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Option<Publish>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Receives the next incoming publish.

Return None if there will be no more incoming publishes.

Source

fn recv_manual_ack<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Option<(Publish, Option<AckToken>)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Receives the next incoming publish, and a token that can be used to manually acknowledge the publish (Quality of Service 1 or 2), or None (Quality of Service 0).

Return None if there will be no more incoming publishes.

Source

fn close(&mut self)

Close the receiver, preventing further incoming publishes.

To guarantee no publish loss, recv()/recv_manual_ack() must be called until None is returned.

Implementors§

Source§

impl PubReceiver for azure_iot_operations_mqtt::session::managed_client::SessionPubReceiver

Source§

impl PubReceiver for azure_iot_operations_mqtt::session::SessionPubReceiver