Skip to content
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

Tracking Issue for bufreader_peek #128405

Open
2 of 4 tasks
lolbinarycat opened this issue Jul 30, 2024 · 2 comments
Open
2 of 4 tasks

Tracking Issue for bufreader_peek #128405

lolbinarycat opened this issue Jul 30, 2024 · 2 comments
Assignees
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. F-bufreader_peek `#![feature(bufreader_peek)]` T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@lolbinarycat
Copy link
Contributor

lolbinarycat commented Jul 30, 2024

Feature gate: #![feature(bufreader_peek)]

This is a tracking issue for the BufReader::peek method.

Public API

// std::io

impl BufReader {
    fn peek(&mut self, n: usize) -> io::Result<&[u8]>
}

Steps / History

Unresolved Questions

  • what should happen if n > capacity? options are: short slice, error, or panic.
  • should the buffer be completely filled, or should it only read the number of bytes requested?

Footnotes

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

@lolbinarycat lolbinarycat added C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jul 30, 2024
@lolbinarycat lolbinarycat changed the title Tracking Issue for XXX Tracking Issue for bufreader_peek Jul 30, 2024
@lolbinarycat
Copy link
Contributor Author

@rustbot claim

starting work on implementation

@jieyouxu jieyouxu added the F-bufreader_peek `#![feature(bufreader_peek)]` label Jul 31, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Aug 6, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Aug 6, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Aug 6, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Aug 7, 2024
Rollup merge of rust-lang#128406 - lolbinarycat:bufreader_peek, r=Mark-Simulacrum

implement BufReader::peek

Part of rust-lang#128405
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Aug 7, 2024
@lolbinarycat
Copy link
Contributor Author

calling peek should allow you to call consume with the same or a smaller n value. currently consume is only guaranteed to be well-behaved when calling it after fill_buf.

workingjubilee added a commit to workingjubilee/rustc that referenced this issue Aug 29, 2024
…d, r=workingjubilee

allow BufReader::peek to be called on unsized types

rust-lang#128405
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Aug 29, 2024
…d, r=workingjubilee

allow BufReader::peek to be called on unsized types

rust-lang#128405
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Aug 30, 2024
…d, r=workingjubilee

allow BufReader::peek to be called on unsized types

rust-lang#128405
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Aug 30, 2024
…d, r=workingjubilee

allow BufReader::peek to be called on unsized types

rust-lang#128405
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Aug 31, 2024
…d, r=workingjubilee

allow BufReader::peek to be called on unsized types

rust-lang#128405
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Aug 31, 2024
…d, r=workingjubilee

allow BufReader::peek to be called on unsized types

rust-lang#128405
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Aug 31, 2024
…d, r=workingjubilee

allow BufReader::peek to be called on unsized types

rust-lang#128405
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Aug 31, 2024
…d, r=workingjubilee

allow BufReader::peek to be called on unsized types

rust-lang#128405
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Aug 31, 2024
Rollup merge of rust-lang#129675 - lolbinarycat:bufreader_peek_unsized, r=workingjubilee

allow BufReader::peek to be called on unsized types

rust-lang#128405
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. F-bufreader_peek `#![feature(bufreader_peek)]` 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