Skip to main content

ProcessSortKey

Enum ProcessSortKey 

Source
pub enum ProcessSortKey {
    Cpu,
    Memory,
    Read,
    Write,
    Pid,
    Name,
    Age,
    User,
    State,
    Threads,
    Virtual,
}
Expand description

A sortable column of the process table (§7.2).

One variant per sortable column, using the same names the [processes] sort config key and the --sort flag accept (§12), so a config value round-trips through ProcessSortKey::as_str and FromStr without a translation table somewhere else in the codebase.

Variants§

§

Cpu

CPU percentage, core-normalized. The default, per §12.

§

Memory

Resident set size.

Also the ordering of the MEM% column: the share of total memory is RSS divided by a constant, so it produces the same order and does not need a second key (§7.2 lists them as one priority level).

§

Read

Read throughput.

§

Write

Write throughput.

§

Pid

Process id.

§

Name

Process name, then command line.

§

Age

Time since the process started.

§

User

Owning user.

§

State

Scheduling state.

§

Threads

Thread count.

§

Virtual

Virtual size.

Implementations§

Source§

impl ProcessSortKey

Source

pub const ALL: [Self; 11]

Every key, in the order the sort selector (s, §6.2) should list them.

Ordered by the §7.2 column priority so the most useful sorts are the ones nearest the top of the selector.

Source

pub const NAMES: &'static str = "cpu, memory, read, write, pid, name, age, user, state, threads, virtual"

The canonical names, for the “expected one of …” half of a config error.

Source

pub const fn as_str(self) -> &'static str

The canonical configuration name (§12).

Source

pub const fn label(self) -> &'static str

A human label for the sort selector and the status line.

Trait Implementations§

Source§

impl Clone for ProcessSortKey

Source§

fn clone(&self) -> ProcessSortKey

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ProcessSortKey

Source§

impl Debug for ProcessSortKey

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProcessSortKey

Source§

fn default() -> ProcessSortKey

Returns the “default value” for a type. Read more
Source§

impl Display for ProcessSortKey

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ProcessSortKey

Source§

impl FromStr for ProcessSortKey

Source§

fn from_str(text: &str) -> Result<Self, Self::Err>

Parses a sort field name.

ASCII case is ignored and - is accepted for _, because a value typed on the command line and a value written in TOML should not disagree. The alias list is fixed and local: §12 requires configuration parsing to be deterministic, so there is no fuzzy matching and no locale involvement.

Source§

type Err = UnknownSortKey

The associated error which can be returned from parsing.
Source§

impl Hash for ProcessSortKey

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ProcessSortKey

Source§

fn eq(&self, other: &ProcessSortKey) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ProcessSortKey

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.