Skip to main content

Classify

Trait Classify 

Source
pub trait Classify {
    // Required method
    fn kind(&self) -> ErrorKind;

    // Provided methods
    fn is_retryable(&self) -> bool { ... }
    fn requires_dlq(&self) -> bool { ... }
}
Expand description

Fault-domain classification for error types.

Implement kind() only; is_retryable() and requires_dlq() have correct default implementations derived from kind().

Required Methods§

Source

fn kind(&self) -> ErrorKind

Returns the fault domain this error belongs to.

Provided Methods§

Source

fn is_retryable(&self) -> bool

Returns true if the operation may be retried.

Only ErrorKind::Transient errors are retryable.

Source

fn requires_dlq(&self) -> bool

Returns true if the message should be routed to the Dead Letter Queue.

Only ErrorKind::Corrupt errors require DLQ routing.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§