Skip to content

Tracking Issue for borrowed_buf_init #160476

Description

@tgross35

Feature gate: #![feature(borrowed_buf_init)]

This is a tracking issue for borrowed_buf_init

Public API

impl<'data, T> BorrowedBuf<'data, T> {
    pub fn is_init(&self) -> bool;
}

impl<'data, T: Copy> BorrowedBuf<'data, T> {
    pub unsafe fn set_init(&mut self) -> &mut Self;
}

impl<'a, T: Copy> BorrowedCursor<'a, T> {
    pub fn is_init(&self) -> bool;
    pub unsafe fn set_init(&mut self);
    pub fn advance_checked(&mut self, n: usize) -> &mut Self;
}

impl<'a> BorrowedCursor<'a, u8> {
    pub fn ensure_init(&mut self) -> &mut [u8];
}

Steps / History

Unresolved Questions

  • Can the bounds for ensure_init be weakened to T: Default? Or should we have API more similar to [T: Clone]::fill(&mut self, value: T) / [T]::fill_with<F: FnMut() -> T>(&mut self, f: F)?

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 RFCS-tracking-unimplementedStatus: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions