tower/spawn_ready/layer.rs
1/// Spawns tasks to drive its inner service to readiness.
2#[derive(Clone, Debug, Default)]
3pub struct SpawnReadyLayer(());
4
5impl SpawnReadyLayer {
6 /// Builds a [`SpawnReadyLayer`].
7 pub fn new() -> Self {
8 Self::default()
9 }
10}
11
12impl<S> tower_layer::Layer<S> for SpawnReadyLayer {
13 type Service = super::SpawnReady<S>;
14
15 fn layer(&self, service: S) -> Self::Service {
16 super::SpawnReady::new(service)
17 }
18}