pub struct Pid {
pub fds: Vec<PidFd>,
pub nss: Vec<PidNs>,
}
Fields§
§fds: Vec<PidFd>
§nss: Vec<PidNs>
Implementations§
Source§impl Pid
impl Pid
Sourcepub fn from_file<P>(path: P) -> Pid
pub fn from_file<P>(path: P) -> Pid
Examples found in repository?
examples/pid.rs (line 15)
4fn main() {
5 env_logger::init();
6 // let mut pids = Vec::default();
7 for entry in fs::read_dir("/proc").unwrap() {
8 let name = entry.unwrap();
9
10 if name.file_name().to_string_lossy().parse::<u32>().is_ok() {
11 // pids.push(Pid::from_file(name.path()).unwrap());
12 println!(
13 "{:?}: {:?}",
14 name.path(),
15 Pid::from_file(name.path())
16 );
17 }
18 }
19}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pid
impl RefUnwindSafe for Pid
impl Send for Pid
impl Sync for Pid
impl Unpin for Pid
impl UnwindSafe for Pid
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more