Skip to main content

Layer

Trait Layer 

Source
pub trait Layer<H> {
    type Handler;

    // Required method
    fn layer(&self, inner: H) -> Self::Handler;
}
Expand description

A function from one handler to another. Apply with HandlerExt::with.

Required Associated Types§

Source

type Handler

The handler type produced by this layer.

Required Methods§

Source

fn layer(&self, inner: H) -> Self::Handler

Wrap inner and return the composed handler.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<H, Inner, Outer> Layer<H> for Stack<Inner, Outer>
where Inner: Layer<H>, Outer: Layer<Inner::Handler>,

Source§

type Handler = <Outer as Layer<<Inner as Layer<H>>::Handler>>::Handler

Source§

impl<H> Layer<H> for Identity

Source§

impl<H> Layer<H> for TracingLayer

Source§

impl<I, H> Layer<H> for DynStack<I>
where I: Sync, H: Handler<I>,