Implementing a dynamic data structure
In this section, we will enhance the template engine from Chapter 3, Introduction to the Rust Standard Library and Key Crates for Systems Programming, to add support for multiple template variables in one statement. We will achieve this by converting a static data structure into a dynamic data structure.
We will refresh our memory with the model of the template engine shown in Figure 5.7:
You will recall that we implemented a template engine in Chapter 3, Introduction to the Rust Standard Library and Key Crates for Systems Programming, to parse an input statement with a template variable and convert it into a dynamic HTML statement using context data provided. We will enhance the template variable feature in this section. We will first discuss the design changes...