pub fn write<M: Message>(msg: &M, buf: &mut [u8]) -> Result<usize, WriteError>
Serialize a protobuf message to a buffer.