pub struct DefaultStore { /* private fields */ }Expand description
Process tree store backed by HashMap<Mutex> with optional TTL eviction.
Thread-safe via Arc<Mutex<...>>. Cloning shares the same data.
Implementations§
Source§impl DefaultStore
impl DefaultStore
Sourcepub fn new(ttl_secs: u64) -> Self
pub fn new(ttl_secs: u64) -> Self
Create a new store with the given TTL in seconds.
ttl_secs = 0 means no expiration.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Number of entries (including possibly-expired ones not yet evicted).
Sourcepub fn contains_key(&self, pid: u32) -> bool
pub fn contains_key(&self, pid: u32) -> bool
Check if a PID exists in the store.
Does not trigger TTL eviction — use get_process
to check existence with TTL enforcement.
Trait Implementations§
Source§impl Clone for DefaultStore
impl Clone for DefaultStore
Source§impl ProcessStore for DefaultStore
impl ProcessStore for DefaultStore
Source§fn get_process(&self, pid: u32) -> Option<ProcessInfo>
fn get_process(&self, pid: u32) -> Option<ProcessInfo>
Get process info by PID.
Source§fn insert_process(&self, pid: u32, info: ProcessInfo)
fn insert_process(&self, pid: u32, info: ProcessInfo)
Insert or update process info.
Source§fn remove_process(&self, pid: u32) -> Option<ProcessInfo>
fn remove_process(&self, pid: u32) -> Option<ProcessInfo>
Remove a process by PID. Returns the removed process info.
Auto Trait Implementations§
impl Freeze for DefaultStore
impl RefUnwindSafe for DefaultStore
impl Send for DefaultStore
impl Sync for DefaultStore
impl Unpin for DefaultStore
impl UnsafeUnpin for DefaultStore
impl UnwindSafe for DefaultStore
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