obkrnl/signal/
mod.rs

1/// Value of *nix signal.
2#[derive(Debug, Clone, Copy)]
3pub struct Signal(u8);
4
5impl Signal {
6    const MAX: u8 = 128; // _SIG_MAXSIG
7
8    /// # Panics
9    /// If `v` is not a valid signal number.
10    pub const fn from_bits(v: u8) -> Self {
11        assert!(v <= Self::MAX);
12        Self(v)
13    }
14
15    pub const fn into_bits(self) -> u8 {
16        self.0
17    }
18}