pub enum CorsaError {
Io(Error),
Json(Error),
Base64(DecodeError),
Rpc(RpcResponseError),
Protocol(CompactString),
UnexpectedMessage(CompactString),
InvalidHandle(CompactString),
Closed(&'static str),
Unsupported(&'static str),
Join(CompactString),
Timeout(CompactString),
}Expand description
Workspace-wide error type for process, transport, and protocol failures.
Variants§
Io(Error)
Underlying OS or process I/O failure.
Json(Error)
JSON serialization or deserialization failure.
Base64(DecodeError)
Base64 decoding failure for binary JSON payloads.
Rpc(RpcResponseError)
Error returned by the remote JSON-RPC peer.
Protocol(CompactString)
Protocol-level invariant violation or user-facing contract error.
UnexpectedMessage(CompactString)
Message shape did not match what the transport expected.
InvalidHandle(CompactString)
Opaque handle payload could not be parsed.
Closed(&'static str)
Operation could not continue because the underlying resource is closed.
Unsupported(&'static str)
Requested feature or transport is not supported.
Join(CompactString)
Thread/task join failure surfaced as a stable string.
Timeout(CompactString)
Operation did not finish before the configured deadline.
Implementations§
Source§impl CorsaError
impl CorsaError
Sourcepub fn diagnostic(&self) -> CompactString
pub fn diagnostic(&self) -> CompactString
Formats the error for command-line tools with a short recovery hint.
Sourcepub fn recovery_hint(&self) -> Option<&'static str>
pub fn recovery_hint(&self) -> Option<&'static str>
Returns a user-facing hint for broad classes of operational failures.
Sourcepub fn clone_for_pending(&self) -> CorsaError
pub fn clone_for_pending(&self) -> CorsaError
Clones an error into a form safe to send to pending waiters.
Some inner error types are not cheaply cloneable, so this method preserves the important semantics while normalizing them into owned variants.
Sourcepub fn timeout(operation: &str, duration: Duration) -> CorsaError
pub fn timeout(operation: &str, duration: Duration) -> CorsaError
Creates a timeout error for a named operation.
Trait Implementations§
Source§impl Debug for CorsaError
impl Debug for CorsaError
Source§impl Display for CorsaError
impl Display for CorsaError
Source§impl Error for CorsaError
impl Error for CorsaError
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<DecodeError> for CorsaError
impl From<DecodeError> for CorsaError
Source§fn from(source: DecodeError) -> CorsaError
fn from(source: DecodeError) -> CorsaError
Source§impl From<Error> for CorsaError
impl From<Error> for CorsaError
Source§fn from(source: Error) -> CorsaError
fn from(source: Error) -> CorsaError
Source§impl From<Error> for CorsaError
impl From<Error> for CorsaError
Source§fn from(source: Error) -> CorsaError
fn from(source: Error) -> CorsaError
Auto Trait Implementations§
impl Freeze for CorsaError
impl !RefUnwindSafe for CorsaError
impl Send for CorsaError
impl Sync for CorsaError
impl Unpin for CorsaError
impl UnsafeUnpin for CorsaError
impl !UnwindSafe for CorsaError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more