pub trait MqttPubSub {
// Required methods
fn publish<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
retain: bool,
payload: impl 'async_trait + Into<Bytes> + Send,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, PublishError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn publish_with_properties<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
retain: bool,
payload: impl 'async_trait + Into<Bytes> + Send,
properties: PublishProperties,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, PublishError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subscribe<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, SubscribeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subscribe_with_properties<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
properties: SubscribeProperties,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, SubscribeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn unsubscribe<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, UnsubscribeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn unsubscribe_with_properties<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
properties: UnsubscribeProperties,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, UnsubscribeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
MQTT publish, subscribe and unsubscribe functionality
Required Methods§
Sourcefn publish<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
retain: bool,
payload: impl 'async_trait + Into<Bytes> + Send,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, PublishError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn publish<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
retain: bool,
payload: impl 'async_trait + Into<Bytes> + Send,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, PublishError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
MQTT Publish
If connection is unavailable, publish will be queued and delivered when connection is re-established. Blocks if at capacity for queueing.
Sourcefn publish_with_properties<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
retain: bool,
payload: impl 'async_trait + Into<Bytes> + Send,
properties: PublishProperties,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, PublishError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn publish_with_properties<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
retain: bool,
payload: impl 'async_trait + Into<Bytes> + Send,
properties: PublishProperties,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, PublishError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
MQTT Publish
If connection is unavailable, publish will be queued and delivered when connection is re-established. Blocks if at capacity for queueing.
Sourcefn subscribe<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, SubscribeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, SubscribeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
MQTT Subscribe
If connection is unavailable, subscribe will be queued and delivered when connection is re-established. Blocks if at capacity for queueing.
Sourcefn subscribe_with_properties<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
properties: SubscribeProperties,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, SubscribeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_with_properties<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
qos: QoS,
properties: SubscribeProperties,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, SubscribeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
MQTT Subscribe
If connection is unavailable, subscribe will be queued and delivered when connection is re-established. Blocks if at capacity for queueing.
Sourcefn unsubscribe<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, UnsubscribeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn unsubscribe<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, UnsubscribeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
MQTT Unsubscribe
If connection is unavailable, unsubscribe will be queued and delivered when connection is re-established. Blocks if at capacity for queueing.
Sourcefn unsubscribe_with_properties<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
properties: UnsubscribeProperties,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, UnsubscribeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn unsubscribe_with_properties<'life0, 'async_trait>(
&'life0 self,
topic: impl 'async_trait + Into<String> + Send,
properties: UnsubscribeProperties,
) -> Pin<Box<dyn Future<Output = Result<CompletionToken, UnsubscribeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
MQTT Unsubscribe
If connection is unavailable, unsubscribe will be queued and delivered when connection is re-established. Blocks if at capacity for queueing.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.