12.8 Enum Methods with impl
Right, so you’ve defined a nice, tidy enum. It feels good, doesn’t it? You’ve corralled a bunch of related but different data into a single, type-safe concept. But now you’re looking at it, thinking, “Okay, great, I have this Message type, but how do I actually do anything with it? Do I have to write a function that takes one of these and then use a giant match statement every single time I want to, say, send it?”