I've been experimenting with the Tokio libraries for playing with TCP servers and clients. A server is almost always constructed like so:
TcpServer::new(Http, addr)
.serve(|| Ok(HelloWorld));
I'm curious to know what the ||
operator does and how it's used in this expression?
Here are some complete server examples based on Tokio MiniHTTP.