#[non_exhaustive]pub enum RequestError<DE> {
Timeout {
elapsed: Duration,
},
Client(MqttClientError),
Decode(DE),
CallerClosed,
}Expand description
Failure of one RPC call, as seen by the requester.
This is the RPC machinery failing (timeout, transport, undecodable reply,
caller shut down) — distinct from the remote application saying “no”, which
a responder models in the payload via response = Result<Reply, MyError>
(see docs/DESIGN_RPC.md §6).
DE is the serializer’s DeserializeError for the declared response type,
mirroring DecodeFailure on the subscribe side.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Timeout
No reply arrived within the deadline. The request is NOT retracted (MQTT has no unsend), so the responder may still have executed the handler.
Client(MqttClientError)
Publish/subscribe/transport failure. Carries RequiresV5 (via
MqttClientError::Capability) when the connection is not MQTT 5.
Decode(DE)
The reply arrived but its payload failed to deserialize as the declared response type.
CallerClosed
The MqttRpcCaller (or the connection) shut down
while this call was still awaiting its reply.
Implementations§
Source§impl RequestError<Infallible>
impl RequestError<Infallible>
Sourcepub fn widen<DE>(self) -> RequestError<DE>
pub fn widen<DE>(self) -> RequestError<DE>
Widen the decode-error type of a reply-wait outcome.
The caller machinery
(PendingReply::await_reply) can only
produce Timeout / Client / CallerClosed — it
never decodes, so its DE is Infallible.
The macro-generated call body then decodes with the topic’s serializer
and needs the concrete DE; this maps the payload-agnostic error across
without a fallible cast (the Decode(Infallible) arm is unreachable).
Trait Implementations§
Source§impl<DE> Debug for RequestError<DE>where
DE: Debug,
impl<DE> Debug for RequestError<DE>where
DE: Debug,
Source§impl<DE> Display for RequestError<DE>where
DE: Debug,
impl<DE> Display for RequestError<DE>where
DE: Debug,
Source§impl<DE> Error for RequestError<DE>
impl<DE> Error for RequestError<DE>
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()