Lines Matching defs:OsStr
1 //! This crate allows interacting with the data stored by [`OsStr`] and
6 //! Typically, the only way to losslessly construct [`OsStr`] or [`OsString`]
7 //! from a byte sequence is to use `OsStr::new(str::from_utf8(bytes)?)`, which
28 //! - All characters valid in platform strings are representable. [`OsStr`] and
33 //! [`OsStr::len`] will not necessarily match the number of bytes this crate
49 //! that did not originate from [`OsStr`] or a related struct. The encoding
59 //! This crate is meant to help when you already have an instance of [`OsStr`]
185 use std::ffi::OsStr;
313 ) -> result::Result<Cow<'a, OsStr>, imp::EncodingError>
323 fn cow_os_str_into_path(string: Cow<'_, OsStr>) -> Cow<'_, Path> {
348 /// use std::ffi::OsStr;
355 /// assert_eq!(os_string, OsStr::assert_from_raw_bytes(os_bytes));
383 /// use std::ffi::OsStr;
390 /// assert_eq!(os_string, OsStr::from_raw_bytes(os_bytes).unwrap());
412 /// use std::ffi::OsStr;
417 /// let os_string = OsStr::new(string);
426 impl OsStrBytes for OsStr {
455 cow_os_str_into_path(OsStr::assert_from_raw_bytes(string))
463 OsStr::from_raw_bytes(string).map(cow_os_str_into_path)
599 use std::ffi::OsStr;
613 impl Sealed for OsStr {}