Skip to main content

MatchOptions

Struct MatchOptions 

Source
pub struct MatchOptions {
Show 18 fields pub pattern: String, pub full: bool, pub ignore_case: bool, pub exact: bool, pub inverse: bool, pub newest: bool, pub oldest: bool, pub older: Option<f64>, pub pid: Option<Vec<i32>>, pub parent: Option<Vec<i32>>, pub pgroup: Option<Vec<i32>>, pub group: Option<Vec<u32>>, pub session: Option<Vec<i32>>, pub terminal: Option<Vec<String>>, pub euid: Option<Vec<String>>, pub uid: Option<Vec<String>>, pub runstates: Option<Vec<char>>, pub env: Option<String>,
}
Expand description

Bag of filter and matching options. Each field maps to a command-line flag in pgrep / pkill / skill / snice. None (or an empty string for pattern) means “no filter for this category”; multiple-valued fields are OR’d within the category and AND’d across categories.

Fields§

§pattern: String§full: bool§ignore_case: bool§exact: bool§inverse: bool§newest: bool§oldest: bool§older: Option<f64>§pid: Option<Vec<i32>>§parent: Option<Vec<i32>>§pgroup: Option<Vec<i32>>§group: Option<Vec<u32>>§session: Option<Vec<i32>>§terminal: Option<Vec<String>>§euid: Option<Vec<String>>§uid: Option<Vec<String>>§runstates: Option<Vec<char>>§env: Option<String>

--env NAME (any process whose environment has NAME) or --env NAME=VALUE (NAME must be present with exactly VALUE).

Implementations§

Source§

impl MatchOptions

Source

pub fn has_filter(&self) -> bool

True if at least one selector field is set. Used to decide whether pgrep / pkill can run without an explicit pattern.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.