Skip to main content

FallbackPolicy

Trait FallbackPolicy 

Source
pub trait FallbackPolicy<Response> {
    // Required method
    fn should_fallback(&self, result: &Result<Response, BoxedError>) -> bool;
}
Expand description

Decides if a Fallback service should call its fallback service.

Required Methods§

Source

fn should_fallback(&self, result: &Result<Response, BoxedError>) -> bool

Returns true if the fallback service should handle this request.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<Response, F> FallbackPolicy<Response> for F
where F: Fn(&Result<Response, BoxedError>) -> bool,

Source§

impl<Response> FallbackPolicy<Response> for OnError