azure_iot_operations_mqtt::interface

Trait ManagedClient

Source
pub trait ManagedClient: MqttPubSub {
    type PubReceiver: PubReceiver;

    // Required methods
    fn client_id(&self) -> &str;
    fn create_filtered_pub_receiver(
        &self,
        topic_filter: &str,
    ) -> Result<Self::PubReceiver, TopicParseError>;
    fn create_unfiltered_pub_receiver(&self) -> Self::PubReceiver;
}
Expand description

An MQTT client that has it’s connection state externally managed. Can be used to send messages and create receivers for incoming messages.

Required Associated Types§

Source

type PubReceiver: PubReceiver

The type of receiver used by this client

Required Methods§

Source

fn client_id(&self) -> &str

Get the client id for the MQTT connection

Source

fn create_filtered_pub_receiver( &self, topic_filter: &str, ) -> Result<Self::PubReceiver, TopicParseError>

Creates a new PubReceiver that receives messages on a specific topic

§Errors

Returns a TopicParseError if the pub receiver cannot be registered.

Source

fn create_unfiltered_pub_receiver(&self) -> Self::PubReceiver

Creates a new PubReceiver that receives all messages not sent to other filtered receivers.

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.

Implementors§

Source§

impl ManagedClient for azure_iot_operations_mqtt::session::SessionManagedClient

Source§

impl<PS> ManagedClient for azure_iot_operations_mqtt::session::managed_client::SessionManagedClient<PS>
where PS: MqttPubSub + Clone + Send + Sync,