Intro
In the previous chapter we modelled Ticket
in a vacuum: we defined its fields and their constraints, we learned
how to best represent them in Rust, but we didn't consider how Ticket
fits into a larger system.
We'll use this chapter to build a simple workflow around Ticket
, introducing a (rudimentary) management system to
store and retrieve tickets.
The task will give us an opportunity to explore new Rust concepts, such as:
- Stack-allocated arrays
Vec
, a growable array typeIterator
andIntoIterator
, for iterating over collections- Slices (
&[T]
), to work with parts of a collection - Lifetimes, to describe how long references are valid
HashMap
andBTreeMap
, two key-value data structuresEq
andHash
, to compare keys in aHashMap
Ord
andPartialOrd
, to work with aBTreeMap
Index
andIndexMut
, to access elements in a collection
Exercise
The exercise for this section is located in 06_ticket_management/00_intro