1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct PacketData {
    pub(crate) buffer_idx: u32,
    pub(crate) buffer_len: u32,
}

#[repr(transparent)]
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Debug)]
pub struct ConnectionId(u64);

impl From<u64> for ConnectionId {
    fn from(x: u64) -> Self {
        Self(x)
    }
}

#[repr(u8)]
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Debug)]
pub enum CloseInfo {
    Rx,
    Tx,
    Both,
    Reset,
}