Function serve

Source
pub fn serve<'a, S: Service + Unpin + 'a, T: AsyncRead + AsyncWrite + 'a + Send>(
    stream: T,
    service: S,
) -> impl Future<Output = Result<()>> + 'a + Send
Expand description

Creates a future for running a Service on a stream.

The returned future will run until the stream is closed; if the stream encounters an error, then the future will propagate it and terminate.