Skip to main content

EntityView

Struct EntityView 

Source
pub struct EntityView {
    pub id: String,
    pub kind: GroupKind,
    pub name: String,
    pub aliases: Vec<String>,
    pub owner: Option<String>,
    pub mem: Option<u64>,
    pub gpu: Option<u64>,
    pub cpu: Option<f64>,
    pub idle_s: Option<u64>,
    pub state: Vec<String>,
    pub sandbox: Option<String>,
}
Expand description

Flattened view of an entity for filter evaluation.

Fields§

§id: String§kind: GroupKind§name: String§aliases: Vec<String>§owner: Option<String>§mem: Option<u64>§gpu: Option<u64>§cpu: Option<f64>§idle_s: Option<u64>§state: Vec<String>

Flags such as “idle”, “orphan”, “muted”, “pinned”, “protected”, “reclaimable”, “busy”, “self”, “partial” (footprint is a lower bound), and runtime:<name> for sandboxes.

§sandbox: Option<String>

Implementations§

Source§

impl EntityView

Source

pub fn from_group(g: &Group, s: &Snapshot) -> Self

Source

pub fn time_value(&self, m: TimeMetric) -> Option<f64>

Value of a time metric, carried as a time:<key>=<value> entry in state (like the sandbox runtime; this keeps EntityView’s fields unchanged for frontends that build views by hand). None when unknown: comparisons then never match.

Source

pub fn set_time_value(&mut self, m: TimeMetric, v: Option<f64>)

Sets (or clears, with None) a time metric value (process views built by hand).

Source

pub fn sandbox_runtime(&self) -> Option<&str>

Sandbox runtime carried as a runtime:<name> flag, if any.

Source

pub fn add_state(&mut self, flag: &str)

Adds a profile flag (pinned, muted, …) once.

Source

pub fn add_alias(&mut self, alias: &str)

Adds a user rename/alias usable in queries.

Trait Implementations§

Source§

impl Clone for EntityView

Source§

fn clone(&self) -> Self

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 Debug for EntityView

Source§

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

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

impl Default for EntityView

Source§

fn default() -> Self

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

impl PartialEq for EntityView

Source§

fn eq(&self, other: &Self) -> 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 EntityView

Auto Trait Implementations§

§

impl Forget for EntityView

§

impl Freeze for EntityView

§

impl Move for EntityView

§

impl RefUnwindSafe for EntityView

§

impl Send for EntityView
where RawVecInner: Send,

§

impl Sync for EntityView
where RawVecInner: Sync,

§

impl Unpin for EntityView
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for EntityView

§

impl UnwindSafe for EntityView
where RawVecInner: UnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.