Closed
Description
Feature gate: #![feature(os_str_bytes)]
This is a tracking issue for cross-platform access to the underling bytes (&[u8]
) for &OsStr
by defining it as an unspecified superset of UTF-8.
Assumptions:
- Owned variants of this API are not a blocker for stablization
- Panicking and erroring variants of
from_os_str_bytes_unchecked
are not a blocker for stablization
Public API
impl OsStr {
pub unsafe fn from_os_str_bytes_unchecked(bytes: &[u8]) -> &Self;
pub fn as_os_str_bytes(&self) -> &[u8];
}
impl OsString {
pub unsafe fn from_os_str_bytes_unchecked(bytes: Vec<u8>) -> Self;
pub fn into_os_str_bytes(self) -> Vec<u8>;
}
Steps / History
- Implementation: Allow limited access to
OsStr
bytes #109698, Allow limited access toOsString
bytes #113442 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- What should we refer to this as?
- Currently
os_str_bytes
encoded_bytes
was another name that was brought up
- Currently