#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, Hash)]
pub struct GbpFlags(pub u16);
impl GbpFlags {
pub const ORDERED: u16 = 0x0001;
pub const RELIABLE: u16 = 0x0002;
pub const ACK_REQ: u16 = 0x0004;
pub const SYSTEM: u16 = 0x0008;
pub const CRITICAL: u16 = 0x0010;
pub const fn from_bits(bits: u16) -> Self {
Self(bits)
}
pub const fn has(self, bit: u16) -> bool {
self.0 & bit != 0
}
pub const fn ordered_reliable_ack() -> u16 {
Self::ORDERED | Self::RELIABLE | Self::ACK_REQ
}
pub const fn ordered_reliable_system() -> u16 {
Self::ORDERED | Self::RELIABLE | Self::SYSTEM
}
pub const fn ordered_only() -> u16 {
Self::ORDERED
}
}