Skip to content

Tracking Issue for os_str_bytes #111544

Closed
@epage

Description

@epage

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

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions