pub struct SystemMetrics {
pub cpu_usage: f32,
pub memory_usage: f32,
pub network_rx_rate: f32,
pub network_tx_rate: f32,
pub disk_read_rate: f32,
pub disk_write_rate: f32,
pub battery_level: Option<f32>,
pub battery_charging: Option<bool>,
}Expand description
System resource metrics for reactive backgrounds.
All values are normalized to the range 0.0 - 1.0.
Fields§
§cpu_usage: f32CPU usage as a percentage (0.0 - 1.0).
memory_usage: f32Memory usage as a percentage (0.0 - 1.0).
network_rx_rate: f32Network receive rate, normalized (0.0 - 1.0).
network_tx_rate: f32Network transmit rate, normalized (0.0 - 1.0).
disk_read_rate: f32Disk read rate, normalized (0.0 - 1.0).
disk_write_rate: f32Disk write rate, normalized (0.0 - 1.0).
battery_level: Option<f32>Battery level (0.0 - 1.0), None if no battery.
battery_charging: Option<bool>Whether battery is charging, None if no battery.
Trait Implementations§
Source§impl Clone for SystemMetrics
impl Clone for SystemMetrics
Source§fn clone(&self) -> SystemMetrics
fn clone(&self) -> SystemMetrics
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SystemMetrics
impl Debug for SystemMetrics
Source§impl Default for SystemMetrics
impl Default for SystemMetrics
Source§fn default() -> SystemMetrics
fn default() -> SystemMetrics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SystemMetrics
impl RefUnwindSafe for SystemMetrics
impl Send for SystemMetrics
impl Sync for SystemMetrics
impl Unpin for SystemMetrics
impl UnwindSafe for SystemMetrics
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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