Open
Description
opened on May 30, 2023
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 overridecount
for theCStr::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
andstd::ffi::os
submodules libs-team#134. (Resolution: Store incore::ffi::c_str
.) - Should an
AsRef<CStr>
andas_c_str
method be added toCStrBytes
to reflect theslice::Iter
API?
Activity