pub enum ClientReceivedEvent<'a, const P: usize> {
ApplicationMessage(ApplicationMessage<'a, P>),
Ack,
SubscriptionGrantedBelowMaximumQos {
granted_qos: QualityOfService,
maximum_qos: QualityOfService,
},
PublishedMessageHadNoMatchingSubscribers,
NoSubscriptionExisted,
}Variants§
ApplicationMessage(ApplicationMessage<'a, P>)
Client received an application message published to a subscribed topic
Ack
Client received an acknowledgement/response for a previous message sent to the server (e.g. Connack, Puback, Suback, Unsuback, Pingresp) This can be used to track whether the client is still connected to the server - in particular, there will be an Ack event per ping response. An approach is to call Client::send_ping at least every T seconds, and consider the client to be still connected if there has been an Ack within the last T+N seconds, for some multiple N depending on how long a latency/interruption can be tolerated. To tolerate loss of ping request/response packets, N should be increased so that T+N is a multiple of T.
SubscriptionGrantedBelowMaximumQos
A subscription was granted but was at lower qos than the maximum requested This may or may not require action depending on client requirements - it means that the given subscription will receive published messages at only the granted qos - if the requested maximum qos was absolutely required then the client could respond by showing an error to the user stating the server is incompatible, or possibly trying to unsubscribe and resubscribe, assuming this is expected to make any difference with the server(s) in use.
PublishedMessageHadNoMatchingSubscribers
A published message was received at the server, but had no matching subscribers and so did not reach any receivers This may or may not require action depending on client requirements / expectations E.g. if it was expected there would be subscribers, the client could try resending the message later
NoSubscriptionExisted
This may or may not require action depending on client requirements / expectations E.g. if it was expected there would be a subscription, the client could produce an error, and the user of the client might try reconnecting to the server to set up subscriptions again.
Trait Implementations§
Source§impl<'a, const P: usize> Debug for ClientReceivedEvent<'a, P>
impl<'a, const P: usize> Debug for ClientReceivedEvent<'a, P>
Source§impl<'a, const P: usize> PartialEq for ClientReceivedEvent<'a, P>
impl<'a, const P: usize> PartialEq for ClientReceivedEvent<'a, P>
Source§fn eq(&self, other: &ClientReceivedEvent<'a, P>) -> bool
fn eq(&self, other: &ClientReceivedEvent<'a, P>) -> bool
self and other values to be equal, and is used by ==.