pub struct Error { /* private fields */ }Expand description
The main error type for Asupersync operations.
Implementations§
Source§impl Error
impl Error
Sourcepub const fn is_cancelled(&self) -> bool
pub const fn is_cancelled(&self) -> bool
Returns true if this error represents cancellation.
Sourcepub const fn is_timeout(&self) -> bool
pub const fn is_timeout(&self) -> bool
Returns true if this error is a timeout/deadline condition.
Sourcepub fn with_message(self, msg: impl Into<String>) -> Self
pub fn with_message(self, msg: impl Into<String>) -> Self
Adds a message description to the error.
Sourcepub fn with_context(self, ctx: ErrorContext) -> Self
pub fn with_context(self, ctx: ErrorContext) -> Self
Adds structured context to the error.
Sourcepub fn with_source(self, source: impl Error + Send + Sync + 'static) -> Self
pub fn with_source(self, source: impl Error + Send + Sync + 'static) -> Self
Adds a source error to the chain.
Sourcepub fn cancelled(reason: &CancelReason) -> Self
pub fn cancelled(reason: &CancelReason) -> Self
Creates a cancellation error from a structured reason.
Sourcepub const fn category(&self) -> ErrorCategory
pub const fn category(&self) -> ErrorCategory
Returns the error category.
Sourcepub const fn recoverability(&self) -> Recoverability
pub const fn recoverability(&self) -> Recoverability
Returns the recoverability classification.
Sourcepub const fn is_retryable(&self) -> bool
pub const fn is_retryable(&self) -> bool
Returns true if this error is typically retryable.
Sourcepub const fn recovery_action(&self) -> RecoveryAction
pub const fn recovery_action(&self) -> RecoveryAction
Returns the recommended recovery action for this error.
Sourcepub fn context(&self) -> &ErrorContext
pub fn context(&self) -> &ErrorContext
Returns the error context.
Sourcepub const fn is_encoding_error(&self) -> bool
pub const fn is_encoding_error(&self) -> bool
Returns true if this is an encoding-related error.
Sourcepub const fn is_decoding_error(&self) -> bool
pub const fn is_decoding_error(&self) -> bool
Returns true if this is a decoding-related error.
Sourcepub const fn is_transport_error(&self) -> bool
pub const fn is_transport_error(&self) -> bool
Returns true if this is a transport-related error.
Sourcepub const fn is_distributed_error(&self) -> bool
pub const fn is_distributed_error(&self) -> bool
Returns true if this is a distributed coordination error.
Sourcepub const fn is_connection_error(&self) -> bool
pub const fn is_connection_error(&self) -> bool
Returns true if this is a connection-related error.
Sourcepub fn invalid_encoding_params(detail: impl Into<String>) -> Self
pub fn invalid_encoding_params(detail: impl Into<String>) -> Self
Creates an encoding error with parameters context.
Sourcepub fn data_too_large(actual: u64, max: u64) -> Self
pub fn data_too_large(actual: u64, max: u64) -> Self
Creates a data too large error.
Sourcepub fn insufficient_symbols(received: u32, needed: u32) -> Self
pub fn insufficient_symbols(received: u32, needed: u32) -> Self
Creates an insufficient symbols error for decoding.
Sourcepub fn decoding_failed(reason: impl Into<String>) -> Self
pub fn decoding_failed(reason: impl Into<String>) -> Self
Creates a decoding failed error.
Sourcepub fn routing_failed(destination: impl Into<String>) -> Self
pub fn routing_failed(destination: impl Into<String>) -> Self
Creates a routing failed error.
Sourcepub fn lease_expired(lease_id: impl Into<String>) -> Self
pub fn lease_expired(lease_id: impl Into<String>) -> Self
Creates a lease expired error.
Sourcepub fn quorum_not_reached(achieved: u32, needed: u32) -> Self
pub fn quorum_not_reached(achieved: u32, needed: u32) -> Self
Creates a quorum not reached error.
Creates a node unavailable error.