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()?);

Functionsยง

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).