-
Book Overview & Buying
-
Table Of Contents
Rust Web Programming - Third Edition
By :
In this chapter, we built a functioning nanoservice that has a core layer, a data access layer, and a networking layer. While getting there took a bit of refactoring, our work resulted in a well-structured server where all the layers compile together to be served by the networking layer. To aid in error handling, we also built a glue module that was used by all layers, enabling us to propagate the same error type through all the layers in the nanoservice. At this stage, slotting in other web frameworks or data storage approaches is as simple as creating another Cargo workspace in the networking layer, or another feature in the data access layer.
Also in this chapter, we chained factories to enable our views to be constructed on the fly and added to the server. With this chained factory mechanism, we can slot entire view modules in and out of the configuration when the server is being built.
In the next chapter, we will work with processing requests and responses. We...