We've created a server, but it isn't very useful until it can respond to real requests. In this section, we'll add handlers to the requests and use the principles of REST.
Handling incoming requests
Adding a service function
In the previous section, we implemented simple services based on service_fn_ok functions, which expect the service function not to throw any errors. There are also service_fn functions, which can be used to create handlers that can return an error. These are more suitable for asynchronous Future results. As we saw previously, the Future trait has two associated types: one for a successful result and one for an error. The service_fn function expects the result to be converted...