lxy 0.1.1

A convenient async http and RPC framework in Rust
Documentation
use tower::Layer;

#[derive(Clone, Default)]
pub(crate) struct ContextLayer;

impl<S> Layer<S> for ContextLayer {
  type Service = ContextService<S>;

  fn layer(&self, inner: S) -> Self::Service {
    ContextService { inner }
  }
}

/// Service that sets up [RequestContext](super::RequestContext) for each request.
/// Service implementations are delegated to concrete server providers.
#[derive(Clone)]
pub(crate) struct ContextService<S> {
  pub(crate) inner: S,
}