pub struct PlatformImpl;
Trait Implementations§
Source§impl Platform for PlatformImpl
impl Platform for PlatformImpl
An implementation of Platform
for Linux.
See Platform
for documentation.
fn new() -> Self
Source§fn cpu_load(&self) -> Result<DelayedMeasurement<Vec<CPULoad>>>
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>
fn load_average(&self) -> Result<LoadAverage>
Returns a load average object.
Source§fn memory_and_swap(&self) -> Result<(Memory, Swap)>
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 boot_time(&self) -> Result<OffsetDateTime>
fn boot_time(&self) -> Result<OffsetDateTime>
Returns the system boot time.
Source§fn battery_life(&self) -> Result<BatteryLife>
fn battery_life(&self) -> Result<BatteryLife>
Returns a battery life information object.
Source§fn on_ac_power(&self) -> Result<bool>
fn on_ac_power(&self) -> Result<bool>
Returns whether AC power is plugged in.
Source§fn mounts(&self) -> Result<Vec<Filesystem>>
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>
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>>
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>>
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>
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>
fn cpu_temp(&self) -> Result<f32>
Returns the current CPU temperature in degrees Celsius. Read more
Source§fn socket_stats(&self) -> Result<SocketStats>
fn socket_stats(&self) -> Result<SocketStats>
Returns information about the number of sockets in use
Source§fn cpu_load_aggregate(&self) -> Result<DelayedMeasurement<CPULoad>>
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§
impl Freeze for PlatformImpl
impl RefUnwindSafe for PlatformImpl
impl Send for PlatformImpl
impl Sync for PlatformImpl
impl Unpin for PlatformImpl
impl UnwindSafe for PlatformImpl
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