-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refractor: flesh out semantics of IoVecBuffer[Mut]::read/write_at
Before this patch series, IoVecBuffer[Mut] only ever had to deal with u8 slices, which inherently have an "all or nothing" semanticfor Read and Write. Thus the semantics of read_at and write_at were "return None if the given offset is too large this for IoVecBuffer[Mut], otherwise copy either buf.len() or iovec.len() - offset bytes, whichever is less". This commit changes the second part of this behavior to "copy either buf.len() bytes, or fail", which is how these functions were used in praxis. It also brings the semantics more in line with read and write functions offered elsewhere in the standard library. For now, it still only operates on u8-slices, but should the future need arise to generalize to Read/WriteVolatile, all the pieces are there. Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
- Loading branch information
Showing
4 changed files
with
113 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters