procfs_core/process/
namespaces.rs1use std::collections::HashMap;
2use std::ffi::OsString;
3use std::path::PathBuf;
4
5#[cfg(feature = "serde1")]
6use serde::{Deserialize, Serialize};
7
8#[derive(Debug, Clone, Eq)]
10#[cfg_attr(all(feature = "serde1", not(target_family = "wasm")), derive(Serialize, Deserialize))]
11pub struct Namespace {
12    pub ns_type: OsString,
14    pub path: PathBuf,
16    pub identifier: u64,
18    pub device_id: u64,
20}
21
22impl PartialEq for Namespace {
23    fn eq(&self, other: &Self) -> bool {
24        self.identifier == other.identifier && self.device_id == other.device_id
26    }
27}
28
29#[derive(Debug, Clone, PartialEq, Eq)]
31#[cfg_attr(all(feature = "serde1", not(target_family = "wasm")), derive(Serialize, Deserialize))]
32pub struct Namespaces(pub HashMap<OsString, Namespace>);