pub use lancer_core::types::*; #[derive(Debug, PartialEq, Eq)] pub struct BlockedPid { pid: Pid, generation: Generation, } impl BlockedPid { pub(crate) fn from_blocked(pid: Pid, generation: Generation) -> Self { Self { pid, generation } } #[cfg(lancer_test)] pub(crate) unsafe fn trust(pid: Pid) -> Self { Self { pid, generation: Generation::new(0), } } pub const fn pid(&self) -> Pid { self.pid } #[allow(dead_code)] pub const fn generation(&self) -> Generation { self.generation } } #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct NotificationBit(u8); impl NotificationBit { #[allow(dead_code)] pub const ZERO: Self = Self(0); pub fn new(bit: u8) -> Option { if bit < 64 { Some(Self(bit)) } else { None } } pub const fn mask(self) -> u64 { 1u64 << self.0 } } impl core::fmt::Display for NotificationBit { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{}", self.0) } } #[derive(Debug, Clone, Copy, PartialEq, Eq)] #[repr(transparent)] pub struct CreatedPid(Pid); impl CreatedPid { pub(crate) fn trust(pid: Pid) -> Self { Self(pid) } pub const fn pid(self) -> Pid { self.0 } }