rust-lang / rust-lang/rust

Tracking Issue for `read_buf_at`

Open
#140,771 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-io C-tracking-issue S-tracking-blocked T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing implementation PR #140459 and the public APIs in std::os::unix::fs::FileExt and std::os::windows::fs::FileExt, then read the linked read_buf and core_io_borrowed_buf tracking issues. Resolve the listed pre-stabilization questions and complete the FCP and stabilization steps; done means the feature is ready for a stabilization PR.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.