#[non_exhaustive]pub enum CallError {
Rejected(ErrorObject),
InvalidResponse(ErrorObject),
TimedOut,
Cancelled,
Evicted,
Closed,
WouldDeadlock,
}std only.Expand description
Why an outgoing request produced no result.
Every request ends in exactly one outcome: its result, or one of these.
§Examples
use rpc_io::{CallError, ErrorObject};
let e = CallError::Rejected(ErrorObject::method_not_found("x"));
assert_eq!(e.to_string(), "the peer answered with an error: method not found: `x` (code -32601)");
assert_eq!(CallError::TimedOut.to_string(), "the request timed out");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Rejected(ErrorObject)
The peer answered with this error.
InvalidResponse(ErrorObject)
The peer’s answer was not a valid response; this describes how.
TimedOut
The deadline passed without an answer. The peer was told to cancel.
Cancelled
The request was cancelled (by Call::cancel, a
Canceller, or because the gate’s opening request
failed before it was sent).
Evicted
More requests were outstanding than Config::max_pending
allows and this was the oldest. The peer was told to cancel.
Closed
The connection closed before an answer arrived.
WouldDeadlock
Waiting here would block the thread that reads the answer: a handler
cannot wait for a request it sent. Use Call::try_wait
later, or wait on another thread.
Trait Implementations§
impl Eq for CallError
Source§impl Error for CallError
impl Error for CallError
1.30.0 · 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()