1use flood_rs::prelude::*;
6
7#[derive(Debug)]
8pub struct ClientTime(u16);
9
10impl ClientTime {
11 pub fn new(time: u16) -> Self {
12 Self(time)
13 }
14}
15
16impl Serialize for ClientTime {
17 fn serialize(&self, stream: &mut impl WriteOctetStream) -> std::io::Result<()>
18 where
19 Self: Sized,
20 {
21 stream.write_u16(self.0)
22 }
23}
24
25impl Deserialize for ClientTime {
26 fn deserialize(stream: &mut impl ReadOctetStream) -> std::io::Result<Self>
27 where
28 Self: Sized,
29 {
30 Ok(Self(stream.read_u16()?))
31 }
32}