Trait ClassifyEos

trait ClassifyEos

Trait for classifying end of streams (EOS) as either success or failure.

Associated Types

type FailureClass

The type of failure classifications.

Required Methods

fn classify_eos(self: Self, trailers: Option<&HeaderMap>) -> Result<(), <Self as >::FailureClass>

Perform the classification from response trailers.

fn classify_error<E>(self: Self, error: &E) -> <Self as >::FailureClass
where
    E: Display + 'static

Classify an error.

Errors are always errors (doh) but sometimes it might be useful to have multiple classes of errors. A retry policy might allow retrying some errors and not others.

Provided Methods

fn map_failure_class<F, NewClass>(self: Self, f: F) -> MapFailureClass<Self, F>
where
    Self: Sized,
    F: FnOnce(<Self as >::FailureClass) -> NewClass

Transform the failure classification using a function.

See ClassifyResponse::map_failure_class for more details.

Implementors