#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
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, or the topic is invalid).
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
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
Mutably borrows from an owned value. Read more