1 2 3 #[allow(dead_code)] 4 #[derive(Debug, Clone, Copy)] 5 #[repr(u8)] 6 pub enum PidType { 7 /// pid类型是进程id 8 PID = 1, 9 TGID = 2, 10 PGID = 3, 11 SID = 4, 12 MAX = 5, 13 } 14 15 /// 为PidType实现判断相等的trait 16 impl PartialEq for PidType { 17 fn eq(&self, other: &PidType) -> bool { 18 *self as u8 == *other as u8 19 } 20 } 21