Generic utilities for encoding/decoding packets.
- Generates an enum value where each variant can be converted into a constant in the given raw_type.
- A decodable type can be created from a byte buffer. The type returned is separate (copied) from the buffer once decoded.
- An encodable type can write itself into a byte buffer.