pub struct LayerAdapter<L, State> { /* private fields */ }Expand description
Adapter to use a tower::Layer-tower::Service as a rama::Layer-rama::Service.
The produced tower::Service will be wrapped by a [LayerServiceAdapter] making it
a fully compatible rama::Service ready to be plugged into a rama stack.
Note that you should use ServiceAdapter or [SharedServiceAdapter] for non-layer services.
Implementations§
Source§impl<L: Send + Sync + 'static, State> LayerAdapter<L, State>
impl<L: Send + Sync + 'static, State> LayerAdapter<L, State>
Sourcepub fn new(layer: L) -> Self
pub fn new(layer: L) -> Self
Adapt a tower::Layer into a rama::Layer.
See LayerAdapter for more information.
Sourcepub fn into_inner(self) -> L
pub fn into_inner(self) -> L
Consume itself to return the inner tower::Layer back.
Trait Implementations§
Source§impl<L: Debug, State> Debug for LayerAdapter<L, State>
impl<L: Debug, State> Debug for LayerAdapter<L, State>
Source§impl<L, S, State> Layer<S> for LayerAdapter<L, State>
impl<L, S, State> Layer<S> for LayerAdapter<L, State>
Source§type Service = LayerAdapterService<<L as Layer<TowerAdapterService<S, State>>>::Service>
type Service = LayerAdapterService<<L as Layer<TowerAdapterService<S, State>>>::Service>
The service produced by the layer.
Source§fn layer(&self, inner: S) -> Self::Service
fn layer(&self, inner: S) -> Self::Service
Wrap the given service with the middleware, returning a new service.
Source§fn into_layer(self, inner: S) -> Self::Service
fn into_layer(self, inner: S) -> Self::Service
Same as
layer but consuming self after the service was created. Read moreAuto Trait Implementations§
impl<L, State> Freeze for LayerAdapter<L, State>where
L: Freeze,
impl<L, State> RefUnwindSafe for LayerAdapter<L, State>where
L: RefUnwindSafe,
impl<L, State> Send for LayerAdapter<L, State>where
L: Send,
impl<L, State> Sync for LayerAdapter<L, State>where
L: Sync,
impl<L, State> Unpin for LayerAdapter<L, State>where
L: Unpin,
impl<L, State> UnwindSafe for LayerAdapter<L, State>where
L: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more