pub struct ExitedProcess {
pub pid: u32,
}Expand description
An exited process awaiting explicit removal from the store.
Returned by handle_event and handle_events
for Exit events. The process info stays in the store until
remove is called, allowing late-arriving events
to still look up process info.
§Example
use proc_tree::{DefaultStore, handle_event, ProcEvent, ExitedProcess, ProcessStore};
let store = DefaultStore::new(0);
handle_event(&store, &ProcEvent::Fork { child_pid: 100, parent_pid: 1, timestamp_ns: 0 });
let exited = handle_event(&store, &ProcEvent::Exit { pid: 100 }).unwrap();
assert_eq!(exited.pid, 100);
// Process still in store — caller can still query it
assert!(store.get_process(100).is_some());
// Explicitly remove when done
exited.remove(&store);
assert!(store.get_process(100).is_none());Fields§
§pid: u32The PID of the exited process.
Implementations§
Source§impl ExitedProcess
impl ExitedProcess
Trait Implementations§
Source§impl Clone for ExitedProcess
impl Clone for ExitedProcess
Source§fn clone(&self) -> ExitedProcess
fn clone(&self) -> ExitedProcess
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExitedProcess
impl Debug for ExitedProcess
impl Eq for ExitedProcess
Source§impl PartialEq for ExitedProcess
impl PartialEq for ExitedProcess
Source§fn eq(&self, other: &ExitedProcess) -> bool
fn eq(&self, other: &ExitedProcess) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ExitedProcess
Auto Trait Implementations§
impl Freeze for ExitedProcess
impl RefUnwindSafe for ExitedProcess
impl Send for ExitedProcess
impl Sync for ExitedProcess
impl Unpin for ExitedProcess
impl UnsafeUnpin for ExitedProcess
impl UnwindSafe for ExitedProcess
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