Struct std::ffi::OsStrUnstable [-] [+] [src]

pub struct OsStr {
    // some fields omitted
}

Slices into OS strings.

Methods

impl OsStr

fn from_str(s: &str) -> &OsStr

Coerce directly from a &str slice to a &OsStr slice.

fn to_str(&self) -> Option<&str>

Yield a &str slice if the OsStr is valid unicode.

This conversion may entail doing a check for UTF-8 validity.

fn to_string_lossy(&self) -> CowString

Convert an OsStr to a CowString.

Any non-Unicode sequences are replaced with U+FFFD REPLACEMENT CHARACTER.

fn to_os_string(&self) -> OsString

Copy the slice into an owned OsString.

Trait Implementations

impl PartialEq for OsStr

fn eq(&self, other: &OsStr) -> bool

fn ne(&self, other: &Rhs) -> bool

impl PartialEq<str> for OsStr

fn eq(&self, other: &str) -> bool

fn ne(&self, other: &Rhs) -> bool

impl Eq for OsStr

impl PartialOrd for OsStr

fn partial_cmp(&self, other: &OsStr) -> Option<Ordering>

fn lt(&self, other: &OsStr) -> bool

fn le(&self, other: &OsStr) -> bool

fn gt(&self, other: &OsStr) -> bool

fn ge(&self, other: &OsStr) -> bool

impl PartialOrd<str> for OsStr

fn partial_cmp(&self, other: &str) -> Option<Ordering>

fn lt(&self, other: &Rhs) -> bool

fn le(&self, other: &Rhs) -> bool

fn gt(&self, other: &Rhs) -> bool

fn ge(&self, other: &Rhs) -> bool

impl Ord for OsStr

fn cmp(&self, other: &OsStr) -> Ordering

impl Hash for OsStr

fn hash<H: Hasher>(&self, state: &mut H)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl Debug for OsStr

fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error>

impl ToOwned for OsStr

type Owned = OsString

fn to_owned(&self) -> OsString

impl AsOsStr for OsStr

fn as_os_str(&self) -> &OsStr

impl OsStrExt for OsStr

fn from_bytes(slice: &[u8]) -> &OsStr

fn as_bytes(&self) -> &[u8]

fn to_cstring(&self) -> Result<CString, NulError>

impl OsStrExt for OsStr

fn from_bytes(slice: &[u8]) -> &OsStr

fn as_bytes(&self) -> &[u8]

fn to_cstring(&self) -> Result<CString, NulError>