Skip to main content

EventHandlerError

Enum EventHandlerError 

Source
pub enum EventHandlerError {
    Utf8(Utf8Error),
    UnexpectedApplicationMessageTopic,
    InvalidApplicationMessage,
    UnexpectedApplicationMessage,
    Overflow,
    Closed,
    SubscriptionGrantedBelowMaximumQos {
        granted_qos: QualityOfService,
        maximum_qos: QualityOfService,
    },
    PublishedMessageHadNoMatchingSubscribers,
    NoSubscriptionExisted,
}
Expand description

Errors produced when a ClientNoQueue event handler cannot handle a ClientReceivedEvent. These errors propagate to the user of the client, and so are likely to cause the client to be disconnected. Alternatively, an event handler can use another method to propagate an error if it does not wish for the client to be disconnected, for example logging a warning, or using another target for the error, for example if an event handler uses a channel to send valid events onwards, it could also have a channel for errors.

Variants§

§

Utf8(Utf8Error)

Application Message payload contained invalid utf8 data, when a utf8 string was expected

§

UnexpectedApplicationMessageTopic

The topic of an application message is not expected, for example it doesn’t match our expected subscriptions

§

InvalidApplicationMessage

The contents of an application message are invalid for the handler, and can’t be parsed. For example if a json string is expected, and invalid json is received, or if the json received does not match the expected schema.

§

UnexpectedApplicationMessage

The contents of an application message can be parsed, but are unexpected, e.g. if they are received out of sequence

§

Overflow

A valid, expected event was received, but could not be handled due to an overflow. For example if the messages are sent onwards to a channel, and that channel is at capacity.

§

Closed

A valid, expected event was received, but could not be handled due to the destination for events being closed. For example if the messages are sent onwards to a channel, and that channel is closed.

§

SubscriptionGrantedBelowMaximumQos

The corresponding ClientReceivedEvent was received, and is an error for this event handler

Fields

§granted_qos: QualityOfService
§maximum_qos: QualityOfService
§

PublishedMessageHadNoMatchingSubscribers

The corresponding ClientReceivedEvent was received, and is an error for this event handler

§

NoSubscriptionExisted

The corresponding ClientReceivedEvent was received, and is an error for this event handler

Trait Implementations§

Source§

impl Clone for EventHandlerError

Source§

fn clone(&self) -> EventHandlerError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EventHandlerError

Source§

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

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

impl Display for EventHandlerError

Source§

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

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

impl Format for EventHandlerError

Available on crate feature defmt only.
Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.
Source§

impl From<EventHandlerError> for ClientError

Source§

fn from(value: EventHandlerError) -> Self

Converts to this type from the input type.
Source§

impl From<Utf8Error> for EventHandlerError

Source§

fn from(value: Utf8Error) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for EventHandlerError

Source§

fn eq(&self, other: &EventHandlerError) -> 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 Copy for EventHandlerError

Source§

impl StructuralPartialEq for EventHandlerError

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.