I currently rely on read_u8(16...) and read_exact to deserialize data from the data stream. Although this method also works, I think it is a bit primitive. Is there a better way?
I know serde_json can read data from read , but my data has to be peeked to determine the type of the next packet. Currently, the serialization and deserialization of data packets are implemented manually through Bytes. Is there a better way?