Skip to main content

Module host

Module host 

Source
Expand description

The machine and its environment.

use sys_lib as sys;

println!("running on {}", sys::host::name()?);

Structs§

OpenFiles
How many files are open across the machine.
Processes
How many processes and threads the machine runs. Totals only: no process is listed or inspected.

Functions§

boot_time
When the machine booted: stable when the wall clock steps.
name
The host name. A live reading: DHCP and hostnamectl change it while processes run. A name that is not UTF-8 is converted lossily, and one longer than 255 bytes is truncated (E-95).
open_files
How many files are open across the machine, and the maximum.
processes
How many processes and threads the machine runs.
uptime
The time since the machine booted, including time suspended: monotonic.