Skip to content

Tracking Issue for read_buf_at #140771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 of 4 tasks
niklasf opened this issue May 7, 2025 · 1 comment
Open
1 of 4 tasks

Tracking Issue for read_buf_at #140771

niklasf opened this issue May 7, 2025 · 1 comment
Labels
A-io Area: `std::io`, `std::fs`, `std::net` and `std::path` C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC S-tracking-unimplemented Status: The feature has not been implemented. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@niklasf
Copy link
Contributor

niklasf commented May 7, 2025

Feature gate: #![feature(read_buf_at)]

This is a tracking issue for FileExt::read_buf_at() and related methods, providing positioned reads into unintialized buffers.

#![feature(read_buf)] adds support for reads into unintialized buffers via BorrowedBuf and BorrowedCursor. This feature expands that to reads from specific offsets.

Public API

// std::os::unix::fs
trait FileExt {
    // [...] (existing methods)

    /// Equivalent to read_at()
    fn read_buf_at(&self, buf: BorrowedCursor<'_>, offset: u64) -> io::Result<()>;

    /// Equivalent to read_exact_at()
    fn read_buf_exact_at(&self, buf: BorrowedCursor<'_>, offset: u64) -> io::Result<()>;
}

// std::os::windows::fs
trait FileExt {
    // [...] (existing methods)

    /// Equivalent to seek_read()
    fn seek_read_buf(&self, buf: BorrowedCursor<'_>, offset: u64) -> io::Result<()>;
}

Steps / History

Unresolved Questions

Footnotes

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

@niklasf niklasf added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC S-tracking-unimplemented Status: The feature has not been implemented. labels May 7, 2025
@niklasf

This comment has been minimized.

@rustbot rustbot added the A-io Area: `std::io`, `std::fs`, `std::net` and `std::path` label May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-io Area: `std::io`, `std::fs`, `std::net` and `std::path` C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC S-tracking-unimplemented Status: The feature has not been implemented. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants