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