-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: 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.Relevant 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.This issue / PR is in PFCP or FCP with a disposition to merge it.proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
Description
Feature gate: #![feature(int_format_into)]
This is a tracking issue for efficient decimal integer formatting into a fixed-size buffer.
Public API
// core::fmt
pub struct NumBuffer<T: NumBufferTrait> { .. }
impl<T: NumBufferTrait> NumBuffer<T> {
pub const fn new() -> Self;
pub const fn capacity(&self) -> usize;
}
impl<T: NumBufferTrait + Debug> Debug for NumBuffer<T>;
pub trait NumBufferTrait {
const BUF_SIZE: usize;
}
impl $Int {
fn format_into(self, &mut NumBuffer<Self>) -> &str;
}Steps / History
- ACP: Efficient integer formatting into fixed-size buffer libs-team#546
- Implementation: Implement
int_format_intofeature #142098 - Final comment period (FCP)1
- Stabilization PR: Stabilize
int_format_intofeature #152544
Unresolved Questions
- Should this return
&[ascii::Char]in the future? Efficient integer formatting into fixed-size buffer libs-team#546 (comment) - Should
NumBufferbeNumBuffer<$Int>so that the reserved space can be tailored to the specific integer's size? Not a big difference with current integer types, but may be significant if we gainu8192in the future. - Naming of
core::num::NumBuffer.
Footnotes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: 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.Relevant 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.This issue / PR is in PFCP or FCP with a disposition to merge it.proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
Type
Fields
Give feedbackNo fields configured for issues without a type.