#[non_exhaustive]pub enum MqttError {
Connect(Box<dyn StdError + Send + Sync>),
Subscribe {
filter: String,
reason: String,
},
Receive(String),
Publish {
topic: String,
reason: String,
},
NotConnected,
Invalid(String),
}Expand description
Errors returned by the MQTT 5 broker.
One enum for the whole crate, variants by source, per the RustStream broker conventions.
The wrapped sources are boxed std errors so the public API does not leak the client’s
error types.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Connect(Box<dyn StdError + Send + Sync>)
Establishing the connection failed (transport, TLS, or the broker refused the connection with a non-retryable reason).
Subscribe
Subscribing failed (the broker rejected the filter, or the connection died).
Fields
Receive(String)
The connection failed permanently while receiving.
Publish
Publishing failed: the connection task is gone, the topic is not one a publish can name (empty, or carrying a wildcard), or the topic or a header is not text an MQTT string carries (not UTF-8, or holding a control character or a Unicode non-character).
NotConnected
The handle is used before connect filled the shared connection, or after shutdown.
Invalid(String)
A broker option or subscription descriptor is invalid.
Trait Implementations§
Source§impl Error for MqttError
impl Error for MqttError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for MqttError
impl !UnwindSafe for MqttError
impl Freeze for MqttError
impl Send for MqttError
impl Sync for MqttError
impl Unpin for MqttError
impl UnsafeUnpin for MqttError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more