#[repr(u8)]pub enum VoxError<E = Infallible> {
User(E),
UnknownMethod,
InvalidPayload(String),
Cancelled,
ConnectionClosed,
SessionShutdown,
SendFailed,
Indeterminate,
}Expand description
Protocol-level error wrapper distinguishing application errors from vox infrastructure errors.
On the caller side, all return types are wrapped as Result<T, VoxError<E>>:
- Infallible
fn foo() -> TbecomesResult<T, VoxError> - Fallible
fn foo() -> Result<T, E>becomesResult<T, VoxError<E>>
Variants§
User(E)
The handler ran and returned an application error.
UnknownMethod
No handler recognized the method ID.
InvalidPayload(String)
The arguments could not be deserialized.
Cancelled
The call was cancelled before completion (e.g. handler dropped without replying).
ConnectionClosed
The underlying connection closed while the call was in flight.
SessionShutdown
The session shut down while the call was in flight.
SendFailed
The call could not be sent because the transport is dead.
Indeterminate
The runtime refused to guess after recovery.
Implementations§
Source§impl<E> VoxError<E>
impl<E> VoxError<E>
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns true if retrying the same operation on a fresh connection may succeed.
InvalidPayload, UnknownMethod, User, Cancelled, and Indeterminate
are permanent failures — retrying them against the same peer will reproduce
the same outcome.
Trait Implementations§
Source§impl<E: Debug + Display> Error for VoxError<E>
impl<E: Debug + Display> Error for VoxError<E>
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()