Tracking Issue for CStr::bytes
· Issue #112115 · rust-lang/rust (original) (raw)
Feature gate: #![feature(cstr_bytes)]
This is a tracking issue for the CStr::bytes
API.
Public API
impl CStr { pub fn bytes(&self) -> CStrBytes<'_>; }
// core::ffi::c_str::Bytes pub struct Bytes<'a> { // ... } impl Iterator for Bytes<'_> { type Item = u8; // ... }
Steps / History
- API change proposal (ACP)1: ACP: CStr::bytes iterator libs-team#135
- Implementation: Add CStr::bytes iterator #104353
- impl Send + Sync and override count for the CStr::bytes iterator #127444
- Final comment period (FCP)2
- Stabilization PR
Unresolved Questions
- Where should this type be located? This is discussed in ACP: std::ffi::c and std::ffi::os submodules libs-team#134. (Resolution: Store in
core::ffi::c_str
.) - Should an
AsRef<CStr>
andas_c_str
method be added toCStrBytes
to reflect theslice::Iter
API?