Trait vector::sinks::util::retries::RetryLogic

source ·
pub trait RetryLogic: Clone + Send + Sync + 'static {
    type Error: Error + Send + Sync + 'static;
    type Response;

    // Required method
    fn is_retriable_error(&self, error: &Self::Error) -> bool;

    // Provided method
    fn should_retry_response(&self, _response: &Self::Response) -> RetryAction { ... }
}

Required Associated Types§

source

type Error: Error + Send + Sync + 'static

source

type Response

Required Methods§

source

fn is_retriable_error(&self, error: &Self::Error) -> bool

When the Service call returns an Err response, this function allows implementors to specify what kinds of errors can be retried.

Provided Methods§

source

fn should_retry_response(&self, _response: &Self::Response) -> RetryAction

When the Service call returns an Ok response, this function allows implementors to specify additional logic to determine if the success response is actually an error. This is particularly useful when the downstream service of a sink returns a transport protocol layer success but error data in the response body. For example, an HTTP 200 status, but the body of the response contains a list of errors encountered while processing.

Object Safety§

This trait is not object safe.

Implementors§