Enum Error

Source
pub enum Error {
Show 36 variants Failure, PersistenceError, Disconnected, MaxMessagesInflight, BadUtf8String, NullParameter, TopicNameTruncated, BadStructure, BadQos, NoMoreMsgIds, OperationIncomplete, MaxBufferedMessages, SslNotSupported, BadProtocol, BadMqttOption, WrongMqttVersion, ZeroLenWillTopic, CommandIgnored, MaxBufferedZero, TcpConnectTimeout, TcpConnectCompletionFailure, TcpTlsConnectFailure, SocketError(i32), ConnectReturn(ConnectReturnCode), ReceivedDisconnect(i32), Publish(i32, Message), ReasonCode(ReasonCode), BadTopicFilter, Io(Error), Utf8(Utf8Error), Nul(NulError), MissingSslOptions, Conversion, Timeout, General(&'static str), GeneralString(String),
}
Expand description

The errors from an MQTT operation.

Variants§

§

Failure

A generic error code indicating the failure of an MQTT client operation.

§

PersistenceError

Persistence error

§

Disconnected

The client is disconnected.

§

MaxMessagesInflight

The maximum number of messages allowed to be simultaneously in-flight has been reached.

§

BadUtf8String

An invalid UTF-8 string has been detected.

§

NullParameter

A NULL parameter has been supplied to the underlying C library when this is invalid.

§

TopicNameTruncated

The topic has been truncated (the topic string includes embedded NULL characters). String functions will not access the full topic. Use the topic length value to access the full topic.

§

BadStructure

A structure parameter passed down to the C library does not have the correct eyecatcher and version number.

§

BadQos

An invaid QoS value was used not 0, 1, or 2)

§

NoMoreMsgIds

All 64k MQTT message ID are currently in use

§

OperationIncomplete

The request is being discarded when not complete

§

MaxBufferedMessages

The limit on the maximum number of message buffers has been reached.

§

SslNotSupported

Attempting SSL connection using non-SSL version of library.

§

BadProtocol

A bad URL protocol/schema was requested/ Note that the TLS enabled prefixes (ssl, mqtts, wss) are only valid if the TLS version of the library is linked int the app.

§

BadMqttOption

Don’t use options for another version of MQTT

§

WrongMqttVersion

Call not applicable to the client’s version of MQTT

§

ZeroLenWillTopic

The LWT topic can not be zero length

§

CommandIgnored

Connect or disconnect command ignored because there is already a connect or disconnect command at the head of the list waiting to be processed. Use the onSuccess/onFailure callbacks to wait for the previous connect or disconnect command to be complete.

§

MaxBufferedZero

The max number of buffered messages can not be zero. The library needs at least one slot for the outbound message.

§

TcpConnectTimeout

The TCP connection timed out

§

TcpConnectCompletionFailure

The TCP connection failed to complete

§

TcpTlsConnectFailure

TCP/TLS connection failure

§

SocketError(i32)

A socket error occurred

§

ConnectReturn(ConnectReturnCode)

§

ReceivedDisconnect(i32)

§

Publish(i32, Message)

A synchronous error when publishing creating or queuing the message.

§

ReasonCode(ReasonCode)

An MQTT v5 error from a reason code.

§

BadTopicFilter

A bad topic filter

§

Io(Error)

An low-level I/O error

§

Utf8(Utf8Error)

An error parsing a UTF-8 string

§

Nul(NulError)

A string NUL error

§

MissingSslOptions

Missing SSL/TLS options

§

Conversion

Conversion error between types

§

Timeout

A timeout, particularly from a synchronous operation.

§

General(&'static str)

A general error with description

§

GeneralString(String)

A general error with description

Trait Implementations§

Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<&'static str> for Error

Source§

fn from(descr: &'static str) -> Error

Create a general error from a string.

Source§

impl From<(i32, &str)> for Error

Source§

fn from((rc, msg): (i32, &str)) -> Self

Converts to this type from the input type.
Source§

impl From<(i32, Option<String>)> for Error

Source§

fn from((rc, msg): (i32, Option<String>)) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for Error

Source§

fn from(err: Error) -> Error

Converts to this type from the input type.
Source§

impl From<Error> for Token

Source§

fn from(err: Error) -> Self

Creates a new token that is already signaled with an error.

Source§

impl From<IntoStringError> for Error

Source§

fn from(_: IntoStringError) -> Self

Converts to this type from the input type.
Source§

impl From<NulError> for Error

Source§

fn from(source: NulError) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Error

Source§

fn from(descr: String) -> Error

Create a general error from a string.

Source§

impl From<Utf8Error> for Error

Source§

fn from(source: Utf8Error) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for Error

Source§

fn from(rc: i32) -> Error

Create an error from a Paho C return code.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

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