pub trait ProtocolError:
Error
+ Send
+ Sync
+ 'static {
// Provided methods
fn can_continue(&self) -> bool { ... }
fn boxed(self) -> Box<dyn ProtocolError>
where Self: Sized { ... }
}Expand description
Protocol-defined error. Each protocol owns its own concrete error type.
can_continue is the policy hook: when a chain returns Err(boxed), the
protocol’s handle/send decides whether the channel survives. The
framework never interprets this flag itself.
Provided Methods§
fn can_continue(&self) -> bool
fn boxed(self) -> Box<dyn ProtocolError>where
Self: Sized,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl ProtocolError for HttpError
impl ProtocolError for HttpError
Source§fn can_continue(&self) -> bool
fn can_continue(&self) -> bool
Returns true if the connection can continue after this error.
Recoverable errors (where a response can still be sent) return true:
Status— user-defined status responseNoRoute— 404, can send response and continuePayloadTooLarge,MethodNotAllowed,UnsupportedMediaType— security checksHeaderTooLarge,TooManyHeaders,HeaderLineTooLong— malformed requestParseError,InvalidHeader,InvalidUri,ChunkError— parsing failuresVersionNotSupported,ProtocolViolation— protocol issuesTimeout— timeoutOther— catch-all
Non-recoverable errors return false:
Io— I/O errors usually mean the connection is brokenConnection— connection-level failures