pub fn spawn_serve<L, M, S>(tcp_listener: L, make_service: M) -> ServeHandlewhere
L: Listener,
L::Addr: Debug,
M: for<'a> Service<IncomingStream<'a, L>, Error = Infallible, Response = S> + Send + 'static,
for<'a> <M as Service<IncomingStream<'a, L>>>::Future: Send,
S: Service<Request, Response = Response, Error = Infallible> + Clone + Send + 'static,
S::Future: Send,
Expand description
A wrapper around axum::serve()
for tests,
which spawns the service in a new thread.
The crate::util::ServeHandle
returned will automatically attempt
to terminate the service when dropped.