Get hostname. Compatible with windows and unix.
Add dependency to Cargo.toml
[dependencies]
hostname = "^0.1"
In your main.rs
or lib.rs
:
extern crate hostname;
use hostname::get_hostname;
assert!(get_hostname().is_some());
hostname is primarily distributed under the terms of the MIT license. See LICENSE for details.