usestd::io;usestd::net::IpAddr;usestd::path::PathBuf;/// Obtain the host's name
pubfnget_host_name()->io::Result<String>{hostname::get()?
.into_string()
.map_err(|_|io::Error::new(io::ErrorKind::InvalidData,"invalid utf-8"))}/// Obtain all of the host's IP addresses
pubfnget_host_ips()->io::Result<impl Iterator<Item=IpAddr>>{Ok(get_if_addrs::get_if_addrs()?
.into_iter()
.map(|interface|interface.addr.ip()))}// Obtain the directory for storing application data
pubfnuser_app_dir(name:&str)->Option<PathBuf>{Some(dirs::config_dir()?.join(name))}