Modelling A Ticket, pt. 2
The Ticket struct we worked on in the previous chapters is a good start,
but it still screams "I'm a beginner Rustacean!".
We'll use this chapter to refine our Rust domain modelling skills. We'll need to introduce a few more concepts along the way:
enums, one of Rust's most powerful features for data modeling- The
Optiontype, to model nullable values - The
Resulttype, to model recoverable errors - The
DebugandDisplaytraits, for printing - The
Errortrait, to mark error types - The
TryFromandTryIntotraits, for fallible conversions - Rust's package system, explaining what's a library, what's a binary, how to use third-party crates
Exercise
The exercise for this section is located in 05_ticket_v2/00_intro