pub trait Serialize {
// Required method
fn serialize(&self, buf: &mut BytesMut) -> u16;
}Expand description
Trait that implements writing data structures to a buffer. This serialize must be independent of protocol version differences for the data structure. Returns the number of bytes written to the buffer.