pub trait IpcErrorKind {
// Required method
fn is_fatal(&self) -> bool;
}Expand description
Classifies an IPC error as either fatal or recoverable.
The IPC client runs a single long-lived processing loop that is shared across every peer and every message. Historically any transport or crypto error tore that loop down, which meant a single transient failure (a handshake timeout, a peer disconnecting mid-send, a malformed frame) permanently disabled the shared client and it never recovered.
This trait lets each layer classify its own errors so the client can distinguish the two cases:
- Fatal (
is_fatal() == true): the client can no longer make progress, so the processing loop should stop. - Recoverable (
is_fatal() == false): only the current operation failed, so the client should stay running and continue processing other messages.
Implementations should classify errors at construction, where the most context is available, and default ambiguous cases to recoverable. Failing open keeps the shared client alive, which is almost always the safer choice.
Required Methods§
Implementations on Foreign Types§
Source§impl IpcErrorKind for Infallible
impl IpcErrorKind for Infallible
Source§impl IpcErrorKind for ()
Available on crate features test-support only.
impl IpcErrorKind for ()
Available on crate features
test-support only.