systemstat::platform::linux

Struct PlatformImpl

Source
pub struct PlatformImpl;

Trait Implementations§

Source§

impl Platform for PlatformImpl

An implementation of Platform for Linux. See Platform for documentation.

Source§

fn new() -> Self

Source§

fn cpu_load(&self) -> Result<DelayedMeasurement<Vec<CPULoad>>>

Returns a delayed vector of CPU load statistics, one object per CPU (core). Read more
Source§

fn load_average(&self) -> Result<LoadAverage>

Returns a load average object.
Source§

fn memory(&self) -> Result<Memory>

Returns a memory information object.
Source§

fn swap(&self) -> Result<Swap>

Returns a swap memory information object.
Source§

fn memory_and_swap(&self) -> Result<(Memory, Swap)>

Returns a swap and a memory information object. On some platforms this is more efficient than calling memory() and swap() separately If memory() or swap() are not implemented for a platform, this function will fail.
Source§

fn uptime(&self) -> Result<Duration>

Returns the system uptime.
Source§

fn boot_time(&self) -> Result<OffsetDateTime>

Returns the system boot time.
Source§

fn battery_life(&self) -> Result<BatteryLife>

Returns a battery life information object.
Source§

fn on_ac_power(&self) -> Result<bool>

Returns whether AC power is plugged in.
Source§

fn mounts(&self) -> Result<Vec<Filesystem>>

Returns a vector of filesystem mount information objects.
Source§

fn mount_at<P: AsRef<Path>>(&self, path: P) -> Result<Filesystem>

Returns a filesystem mount information object for the filesystem at a given path.
Source§

fn block_device_statistics(&self) -> Result<BTreeMap<String, BlockDeviceStats>>

Returns a map of block device statistics objects
Source§

fn networks(&self) -> Result<BTreeMap<String, Network>>

Returns a map of network intefrace information objects. Read more
Source§

fn network_stats(&self, interface: &str) -> Result<NetworkStats>

Returns statistics for a given interface (bytes/packets sent/received)
Source§

fn cpu_temp(&self) -> Result<f32>

Returns the current CPU temperature in degrees Celsius. Read more
Source§

fn socket_stats(&self) -> Result<SocketStats>

Returns information about the number of sockets in use
Source§

fn cpu_load_aggregate(&self) -> Result<DelayedMeasurement<CPULoad>>

Returns a delayed CPU load statistics object, average over all CPUs (cores). Read more

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.