Skip to main content

ClientReceivedEvent

Enum ClientReceivedEvent 

Source
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.

Fields

§granted_qos: QualityOfService
§maximum_qos: QualityOfService
§

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>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, const P: usize> From<Publish<'a, P>> for ClientReceivedEvent<'a, P>

Source§

fn from(value: Publish<'a, P>) -> Self

Converts to this type from the input type.
Source§

impl<'a, const P: usize> PartialEq for ClientReceivedEvent<'a, P>

Source§

fn eq(&self, other: &ClientReceivedEvent<'a, P>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, const P: usize> StructuralPartialEq for ClientReceivedEvent<'a, P>

Auto Trait Implementations§

§

impl<'a, const P: usize> Freeze for ClientReceivedEvent<'a, P>

§

impl<'a, const P: usize> RefUnwindSafe for ClientReceivedEvent<'a, P>

§

impl<'a, const P: usize> Send for ClientReceivedEvent<'a, P>

§

impl<'a, const P: usize> Sync for ClientReceivedEvent<'a, P>

§

impl<'a, const P: usize> Unpin for ClientReceivedEvent<'a, P>

§

impl<'a, const P: usize> UnsafeUnpin for ClientReceivedEvent<'a, P>

§

impl<'a, const P: usize> UnwindSafe for ClientReceivedEvent<'a, P>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.