1.0.0[−][src]Trait std::os::unix::ffi::OsStrExt
This is supported on Unix only.
Unix-specific extensions to OsStr
.
Required methods
ⓘImportant traits for &'_ mut Ifn from_bytes(slice: &[u8]) -> &Self
ⓘImportant traits for &'_ mut I
This is supported on Unix only.
Creates an OsStr
from a byte slice.
Examples
use std::ffi::OsStr; use std::os::unix::ffi::OsStrExt; let bytes = b"foo"; let os_str = OsStr::from_bytes(bytes); assert_eq!(os_str.to_str(), Some("foo"));Run
fn as_bytes(&self) -> &[u8]
This is supported on Unix only.