pub fn serialize<S: Serialize>(value: &S, dst: &mut [u8], cursor: &mut usize)
Serializes the data into a byte slice, with the write starting from the cursor, and advances the cursor by the amount of bytes written.