pub struct ProcessMonitor { /* private fields */ }Expand description
Process monitor for tracking agent processes
Implementations§
Source§impl ProcessMonitor
impl ProcessMonitor
Sourcepub fn track_process(&mut self, pid: u32, agent_type: AgentType)
pub fn track_process(&mut self, pid: u32, agent_type: AgentType)
Track a process by PID
Sourcepub fn untrack_process(&mut self, pid: u32)
pub fn untrack_process(&mut self, pid: u32)
Stop tracking a process
Sourcepub fn is_process_alive(&self, pid: u32) -> bool
pub fn is_process_alive(&self, pid: u32) -> bool
Check if a process is alive
Sourcepub fn get_process_info(&self, pid: u32) -> Option<ProcessInfo>
pub fn get_process_info(&self, pid: u32) -> Option<ProcessInfo>
Get process information
Sourcepub fn find_agent_processes(
&mut self,
agent_type: AgentType,
) -> Vec<ProcessInfo>
pub fn find_agent_processes( &mut self, agent_type: AgentType, ) -> Vec<ProcessInfo>
Find processes matching agent type
Sourcepub fn check_terminated(&mut self) -> Vec<(u32, AgentType)>
pub fn check_terminated(&mut self) -> Vec<(u32, AgentType)>
Monitor tracked processes and return terminated ones
Trait Implementations§
Source§impl Clone for ProcessMonitor
impl Clone for ProcessMonitor
Auto Trait Implementations§
impl Freeze for ProcessMonitor
impl RefUnwindSafe for ProcessMonitor
impl Send for ProcessMonitor
impl Sync for ProcessMonitor
impl Unpin for ProcessMonitor
impl UnsafeUnpin for ProcessMonitor
impl UnwindSafe for ProcessMonitor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more