pub trait Path { fn as_os_str(&self) -> &OsStr; }
Converts the implemented types to OsStr using as_os_str() method. This is NOT std::path::Path
OsStr
as_os_str()
std::path::Path
let path = std::path::Path::new("/usr/bin"); let ostr = path.as_os_str(); assert_eq!(ostr,"/usr/bin");