Structs, Enums and Pattern Matching in Rust
Rust's enums are far more powerful than enums in most languages: each variant can hold its own data. Combined with match , they let you model states so that invalid ones can't exist. Structs and impl #[derive(Debug, Clone)] struct User { id: u64, name: String,...