pub struct ProcQuery { /* private fields */ }
Expand description
Get information about a process
Implementations§
Source§impl ProcQuery
impl ProcQuery
Sourcepub fn process_id(self, pid: Pid) -> Self
pub fn process_id(self, pid: Pid) -> Self
Set the process ID to match
One of this, ProcQuery::process_name or ProcQuery::process_id_from_child must be called before the query is usable.
Sourcepub fn process_name(self, name: impl AsRef<str>) -> Self
pub fn process_name(self, name: impl AsRef<str>) -> Self
Set the process name to match
One of this, ProcQuery::process_id or ProcQuery::process_id_from_child must be called before the query is usable.
Sourcepub fn process_id_from_child(self, child: &Child) -> Self
pub fn process_id_from_child(self, child: &Child) -> Self
Get the process ID of a child process
Either this function or process_id
are required to be called before the query is usable.
Sourcepub fn expect_min_num_children(self, num_children: usize) -> Self
pub fn expect_min_num_children(self, num_children: usize) -> Self
Require at least num_children
children to have been started by the matched process for the query to succeed.
Sourcepub fn list_processes(&self) -> ProcCtlResult<Vec<ProcInfo>>
pub fn list_processes(&self) -> ProcCtlResult<Vec<ProcInfo>>
List all processes matching the current filters.
Sourcepub fn children(&self) -> ProcCtlResult<Vec<ProcInfo>>
pub fn children(&self) -> ProcCtlResult<Vec<ProcInfo>>
Find the children of the selected process
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProcQuery
impl RefUnwindSafe for ProcQuery
impl Send for ProcQuery
impl Sync for ProcQuery
impl Unpin for ProcQuery
impl UnwindSafe for ProcQuery
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> 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