Repository navigation
Labels
A-ioArea: `std::io` (note: `std::fs`, `std::net`, `std::path` are A-filesystem, A-net, A-path)Area: `std::io` (note: `std::fs`, `std::net`, `std::path` are A-filesystem, A-net, A-path)B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.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 RFCI-libs-radarLibs issues that are tracked on the team's radar.Libs issues that are tracked on the team's radar.T-libs-api[DEPRECATED; DO NOT USE][DEPRECATED; DO NOT USE]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.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Description
This is a tracking issue for IoSlice::{advance, advance_slices} and IoSliceMut::{advance, advance_slices}.
Feature gate: #![feature(io_slice_advance)].
Steps:
- Implement the RFC.
- FCP
- Stabilization PR.
Current API additions:
impl<'a> IoSlice<'a> { // And `IoSliceMut`
pub fn advance(&mut self, n: usize);
pub fn advance_slices(bufs: &mut &mut [IoSlice<'a>], n: usize);
}Old issue:
Writing rust-lang/futures-rs#1741 I needed to resort to unsafe code to change the underlying slice in IoSlice (and IoSliceMut). I'm missing a method that can change the underlying slice. @Nemo157 said that I should open an issue.
Current idea would be something like Buf::advance from the bytes crate.
impl IoSlice {
// Advance the internal cursors of the slice by `n` bytes.
fn advance(&mut self, n: usize) {
// ..
}
}Reacted by Thomas Eizinger, Thomas B and Austin Henriksen
Metadata
Metadata
Assignees
Labels
A-ioArea: `std::io` (note: `std::fs`, `std::net`, `std::path` are A-filesystem, A-net, A-path)Area: `std::io` (note: `std::fs`, `std::net`, `std::path` are A-filesystem, A-net, A-path)B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.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 RFCI-libs-radarLibs issues that are tracked on the team's radar.Libs issues that are tracked on the team's radar.T-libs-api[DEPRECATED; DO NOT USE][DEPRECATED; DO NOT USE]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.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Activity
Thomasdezeeuw commentedon Jul 16, 2019
Looking for some feedback as to whether this would be accepted.
Rollup merge of rust-lang#62987 - Thomasdezeeuw:ioslice-advance, r=Th…
[-]Add IoSlice advance or similiar method[/-][+]Tracking issue for io_slice_advance[/+]Thomasdezeeuw commentedon Aug 6, 2019
Can someone reopen this as the tracking issue for
io_slice_advance? I've updated the the first comment, but I'm not sure it's 100% correct.82 remaining items
Thomasdezeeuw commentedon Aug 2, 2024
I don't think we can guarantee that the method will never be incorrectly used. Same for
process::exitfor example... I don't know what you expect the standard library to change about this.zh-jq-b commentedon Aug 2, 2024
Before the stabilization of io_slice_advance, users can use both the original buffer and also the
iovto get the read data.After the stabilization, I'm confused with which one should be used?
For all old methods that take a
IoSliceMut, should I still read the data by using the old way? Will it broken without noticeable API changes?dead-claudia commentedon Aug 3, 2024
@zh-jq-b Consider filing a bug report against anyone who sets them incorrectly.
It's not Rust's fault if someone implements
read_vectoredwrong. It's the fault of whoever wrote the bad implementation for thatio::Readtrait instance method.zh-jq-b commentedon Aug 6, 2024
The
read_vectoredshould be documented to specify what's the wrong implementation. So I opened #128669 for further confirmation.Update platform010 & platform010-aarch64 symlinks
Update platform010 & platform010-aarch64 symlinks
Update platform010 & platform010-aarch64 symlinks
Update platform010 & platform010-aarch64 symlinks
Update platform010 & platform010-aarch64 symlinks
Update platform010 & platform010-aarch64 symlinks
Update platform010 & platform010-aarch64 symlinks
Update platform010 & platform010-aarch64 symlinks
Rollup merge of rust-lang#85802 - Thomasdezeeuw:ioslice-advance, r=m-…