pub enum Error {
Closed,
Timeout,
Transport(Arc<Error>),
Remote(Error),
UnexpectedResponse {
expected: &'static str,
received: &'static str,
},
WrongDirection(&'static str),
TooLarge(usize),
Malformed,
InboundRequestLimitExceeded(usize),
InboundByteLimitExceeded(usize),
}Expand description
Failure of a protocol operation. A remote application’s error is carried by
Error::Remote; it does not by itself end the session.
Variants§
Closed
The session or server was closed locally, including by dropping its owner.
Timeout
The operation’s absolute deadline expired. Remote work may still run.
Transport(Arc<Error>)
The underlying transport failed or the peer reset the session.
Remote(Error)
The peer returned an application error for this request.
UnexpectedResponse
The response’s Message variant does not match the type requested by
Promise::wait(). This does not end the session.
Fields
WrongDirection(&'static str)
The submitted message cannot be sent from this session’s side. Reported through the request or reply promise; this error does not end the session.
TooLarge(usize)
The encoded message exceeds the transport’s sending limit.
Malformed
The peer sent an invalid envelope or payload. The session closes when this
is detected. Nested payloads are checked only when recv() or wait()
reads them.
InboundRequestLimitExceeded(usize)
A peer request would exceed the session’s request limit. Also returned if the limit is lowered below usage. Carries the configured request limit. This closes the session.
InboundByteLimitExceeded(usize)
Buffering an incoming envelope would exceed the session’s byte limit. Also returned if the limit is lowered below usage. Carries the configured byte limit. This closes the session.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Source§impl From<!> for Error
impl From<!> for Error
Source§fn from(error: Infallible) -> Self
fn from(error: Infallible) -> Self
Allows Promise::wait() to return Message without extracting a variant.