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§
Sourcetype PubReceiver: PubReceiver
type PubReceiver: PubReceiver
The type of receiver used by this client
Required Methods§
Sourcefn create_filtered_pub_receiver(
&self,
topic_filter: &str,
) -> Result<Self::PubReceiver, TopicParseError>
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.
Sourcefn create_unfiltered_pub_receiver(&self) -> Self::PubReceiver
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.