These are chat archives for rust-lang/rust

7th
Sep 2016
mhsjlw
@mhsjlw
Sep 07 2016 00:14
I need to write a message-based server in Rust. How should I make the API for it work. Should each message be defined as an Enum, or should each message be struct with a trait that allows for encoding and decoding
I want to be able to easily read and write messages from the tcp stream as quickly as possible with as little pain as possible as well. It also needs to support custom types like a varint with all other types used from the byteorder crate
Peter Atashian
@retep998
Sep 07 2016 03:41
@mhsjlw Having each message be an enum variant is the typically recommended method