Trait rama::layer::MakeLayerError

pub trait MakeLayerError: Sealed + Send + Sync + 'static {
    type Error;

    // Required method
    fn make_layer_error(&self) -> Self::Error;
}
Expand description

Utility error trait to allow Rama layers to return a default error as well as a user-defined one, being it a Clone-able type or a Fn returning an error type.

Required Associated Types§

type Error

The error type returned by the layer.

It does not need to be an actual error type, but it must be Send and of 'static lifetime.

Required Methods§

fn make_layer_error(&self) -> Self::Error

Create a new error value that can be turned into the inner Service’s error type.

Implementors§

§

impl<E> MakeLayerError for LayerErrorStatic<E>
where E: Clone + Send + Sync + 'static,

§

type Error = E

§

impl<F, E> MakeLayerError for LayerErrorFn<F>
where F: FnOnce() -> E + Clone + Send + Sync + 'static, E: Send + 'static,

§

type Error = E