View all comments
Feature gate: #![feature(core_io_borrowed_buf)]
This is a tracking issue for an MVP of core::io, which contains an OS-independent subset of std::io.
Public API
The initial API of this module consists of BorrowedBuf and BorrowedCursor, which were previously only available in std.
Steps / History
See also: #78485
Unresolved Questions
Naming:
Documentation:
API confusion:
Variance:
Trait and bounds:
Other:
View all comments
Feature gate:
#![feature(core_io_borrowed_buf)]This is a tracking issue for an MVP of
core::io, which contains an OS-independent subset ofstd::io.Public API
The initial API of this module consists of
BorrowedBufandBorrowedCursor, which were previously only available instd.Steps / History
BorrowedBufandBorrowedCursorfromstd:iotocore::io#117694See also: #78485
Unresolved Questions
BorrowedBufandBorrowedCursorgeneric over the data #149749) double-check any bounds we might want before stabilizationDebug(which was easy sinceu8: Debug), but for generic do we want always-Debugor only forT: Debug?Naming:
BorrowedCursor::writtenneeds renaming tobuf_written(implementation work only) Tracking Issue forcore_io_borrowed_buf#117693 (comment)core::ioorcore::mem? Tracking Issue forcore_io_borrowed_buf#117693 (comment), #t-libs > `io::BorrowedBuf` or `mem::BorrowedBuf`BorrowedCursorbe renamed toBorrowedWriter? It's more similar toBufWriterthanCursorTracking Issue forcore_io_borrowed_buf#117693 (comment), #t-libs > Why is it called `io::BorrowedCursor`?read_bufTracking Issue forcore_io_borrowed_buf#117693 (comment) (Concern 5)Documentation:
core_io_borrowed_buf#117693 (comment) / Tracking Issue forcore_io_borrowed_buf#117693 (comment)core_io_borrowed_buf#117693 (comment), what exists is confusing and methods are not in useful order Tracking Issue forcore_io_borrowed_buf#117693 (comment) (concern 1)API confusion:
BorrowedCursor::capacityindicates remaining capacity rather than total capacity, unlikeVecTracking Issue forcore_io_borrowed_buf#117693 (comment)borrowed_buf_initis confusing:advanceandadvance_checkedare split, affectsas_mutTracking Issue forcore_io_borrowed_buf#117693 (comment), Tracking Issue forcore_io_borrowed_buf#117693 (comment) (concern 3)into_filledandinto_filled_mut? Tracking Issue forcore_io_borrowed_buf#117693 (comment)core_io_borrowed_buf#117693 (comment)is_empty? (Not blocking) Tracking Issue forcore_io_borrowed_buf#117693 (comment)selfTracking Issue forcore_io_borrowed_buf#117693 (comment)Variance:
BorrowedCursor<'data>, which would be invariant, but make it covariant with a lot ofunsafe. This is fragile compared toBorrowedCursor<'buf, 'data>Tracking Issue forcore_io_borrowed_buf#117693 (comment), Tracking Issue forcore_io_borrowed_buf#117693 (comment), #t-libs > Why is it called `io::BorrowedCursor`? @ 💬Trait and bounds:
Debug? We don't haveT: Debugin the current impl Tracking Issue forcore_io_borrowed_buf#117693 (comment)T: CopyTracking Issue forcore_io_borrowed_buf#117693 (comment)Other:
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩