1 use super::MakeSpawnReady;
2 use tower_layer::Layer;
3 
4 /// Spawns tasks to drive its inner service to readiness.
5 #[derive(Debug, Clone, Default)]
6 pub struct SpawnReadyLayer;
7 
8 impl SpawnReadyLayer {
9     /// Builds a [`SpawnReadyLayer`] with the default executor.
new() -> Self10     pub fn new() -> Self {
11         Self
12     }
13 }
14 
15 impl<S> Layer<S> for SpawnReadyLayer {
16     type Service = MakeSpawnReady<S>;
17 
layer(&self, service: S) -> Self::Service18     fn layer(&self, service: S) -> Self::Service {
19         MakeSpawnReady::new(service)
20     }
21 }
22