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
Unresolved Questions
- What should we refer to this as?
- Currently
os_str_bytes
encoded_bytes was another name that was brought up
Feature gate:
#![feature(os_str_bytes)]This is a tracking issue for cross-platform access to the underling bytes (
&[u8]) for&OsStrby defining it as an unspecified superset of UTF-8.Assumptions:
from_os_str_bytes_uncheckedare not a blocker for stablizationPublic API
Steps / History
OsStrbytes #109698, Allow limited access toOsStringbytes #113442Unresolved Questions
os_str_bytesencoded_byteswas another name that was brought upFootnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩