Skip to main content

TreeReading

Struct TreeReading 

Source
#[non_exhaustive]
pub struct TreeReading { pub measured_at_ms: Option<u64>, pub cpu_ms: u64, pub memory_bytes: u64, pub memory_kind: ChildMemoryKind, pub process_count: u64, pub source: TreeSource, pub bound: Option<ResourceBound>, pub own: Option<TreeOwn>, pub groups: Vec<ProcessGroup>, }
Expand description

Cumulative CPU and current memory of a module and its descendants. Construct with TreeReading::new and its builders, not a struct literal.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§measured_at_ms: Option<u64>

Unix-epoch milliseconds of this measurement, retained when a newer walk fails.

§cpu_ms: u64§memory_bytes: u64§memory_kind: ChildMemoryKind§process_count: u64§source: TreeSource§bound: Option<ResourceBound>

Absent means exact. Memory and process count are not CPU bounds.

§own: Option<TreeOwn>

The root process’s attributed share, omitted when unknown. Its CPU is funded from initial measured CPU and later progress, not its raw counter. Its bound follows the row’s CPU bound.

§groups: Vec<ProcessGroup>

Up to eight child-only program groups by memory, excluding the root identity but retaining children with the same name. Absent means none. Unreadable members invalidate the whole reading, not an empty collection.

Implementations§

Source§

impl TreeReading

Source

pub fn with_measured_at_ms(self, measured_at_ms: Option<u64>) -> Self

Set or clear the measurement’s Unix-epoch millisecond timestamp.

Source

pub fn new( cpu_ms: u64, memory_bytes: u64, memory_kind: ChildMemoryKind, process_count: u64, source: TreeSource, ) -> Self

Create a measured tree without optional root, group or bound metadata.

Source

pub fn with_bound(self, bound: Option<ResourceBound>) -> Self

Set or clear the cumulative CPU lower-bound marker.

Source

pub fn with_own(self, own: Option<TreeOwn>) -> Self

Set or clear the root’s attributed resource share.

Source

pub fn with_groups(self, groups: Vec<ProcessGroup>) -> Self

Replace the live child-only program groups; an empty list clears them.

Trait Implementations§

Source§

impl Clone for TreeReading

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 TreeReading

Source§

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

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

impl<'de> Deserialize<'de> for TreeReading

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for TreeReading

Source§

impl PartialEq for TreeReading

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 Serialize for TreeReading

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for TreeReading

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.