about summary refs log tree commit diff
path: root/library/core/src/io
AgeCommit message (Collapse)AuthorLines
2025-07-17Rollup merge of #143829 - a1phyr:trim_borrowed_buf, r=ChrisDentonLeón Orell Valerian Liehr-29/+6
Trim `BorrowedCursor` API This PR removes some method from the unstable `BorrowedCursor` type. A rational for each change can be found in the message of each commit. I don't think that an ACP is required for this, please tell me if it is not the case. Cc rust-lang/rust#78485 rust-lang/rust#117693
2025-07-14Auto merge of #142885 - a1phyr:borrowed_cursor_to_buf, r=Mark-Simulacrumbors-0/+51
core: Add `BorrowedCursor::with_unfilled_buf` Implementation of https://github.com/rust-lang/libs-team/issues/367. This mainly adds `BorrowedCursor::with_unfilled_buf`, with enables using the unfilled part of a cursor as a `BorrowedBuf`. Note that unlike the ACP, `BorrowedCursor::unfilled_buf` was moved to a `From` conversion. This is more consistent with other ways of creating a `BorrowedBuf` and hides a bit this conversion that requires unsafe code to be used correctly. Cc rust-lang/rust#78485 rust-lang/rust#117693
2025-07-09core: Change `BorrowedCursor::written`'s originBenoît du Garreau-9/+3
This enable removing the `start` field, so `BorrowedCursor` fits in a single register. Because `written` is almost always used in difference with another call, this changes nothing else in practice.
2025-07-09core: Remove `BorrowedCursor::uninit_mut`Benoît du Garreau-10/+3
I assume that this method was there for completeness, but there is hardly any useful use of it: the buffer it gave was not always connected to the start of the cursor and its use required `unsafe` anyway to mark the bytes as initialized.
2025-07-09core: Remove `BorrowedCursor::init_ref` methodBenoît du Garreau-10/+0
This method was not really useful: at no point one would only need to read the initialized part of the cursor without mutating it.
2025-07-03setup CI and tidy to use typos for spellchecking and fix few typosklensy-1/+1
2025-07-01core: Add `BorrowedCursor::with_unfilled_buf`Benoît du Garreau-0/+51
Implementation of https://github.com/rust-lang/libs-team/issues/367. This mainly adds `BorrowedCursor::with_unfilled_buf`, with enables using the unfilled part of a cursor as a `BorrowedBuf`. Note that unlike the ACP, `BorrowedCursor::unfilled_buf` was moved to a `From` conversion. This is more consistent with other ways of creating a `BorrowedBuf` and hides a bit this conversion that requires unsafe code to be used correctly.
2025-06-17Remove a panicking branch in `BorrowedCursor::advance`Benoît du Garreau-3/+3
2025-01-11Add inherent versions of MaybeUninit methods for slicesltdk-7/+7
2024-11-02Add BorrowedBuf::into_filled{,_mut} methods to allow returning buffer with ↵Alex Saveau-0/+20
original lifetime
2024-07-26Fix doc nitsJohn Arundel-5/+5
Many tiny changes to stdlib doc comments to make them consistent (for example "Returns foo", rather than "Return foo", per RFC1574), adding missing periods, paragraph breaks, backticks for monospace style, and other minor nits. https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text
2024-04-15Remove bound checks from `BorrowedBuf` and `BorrowedCursor` methodsBenoît du Garreau-6/+18
2024-04-11core: panic on overflow in `BorrowedCursor`joboet-2/+3
2024-03-10BorrowedCursor docs clarificationRalf Jung-2/+4
2024-02-17Auto merge of #120741 - a1phyr:safe_buffer_advance, r=m-ou-sebors-1/+21
Make `io::BorrowedCursor::advance` safe This also keeps the old `advance` method under `advance_unchecked` name. This makes pattern like `std::io::default_read_buf` safe to write.
2024-02-07Make `io::BorrowedCursor::advance` safeBenoît du Garreau-1/+21
This also keeps the old `advance` method under `advance_unchecked` name. This makes pattern like `std::io::default_read_buf` safe to write.
2023-11-11Rename MaybeUninit::write_sliceKornel-1/+1
#79995
2023-11-09Move `BorrowedBuf` and `BorrowedCursor` from `std:io` to `core::io`John Millikin-0/+307
Assigned new feature name `core_io_borrowed_buf` to distinguish from the `Read::read_buf` functionality in `std::io`.