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

Prototype a new Buffer trait. #1290

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Prototype a new Buffer trait. #1290

wants to merge 8 commits into from

Conversation

sunfishcode
Copy link
Member

I'm experimenting with a Buffer trait similar to #908, however I've run into a few problems. See the questions in examples/new_read.rs for details.

@notgull @SUPERCILEX

Copy link
Contributor

@SUPERCILEX SUPERCILEX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we go with this approach, I feel like there's a pretty good chance compiler folks will improve the error messages for us if we file bug reports. The story around passing in a mutable array but needing a slice instead has annoyed me for quite some time (I usually just as_mut_slice everything). It was pretty confusing to figure out initially, so I'm sure better error messages would be welcome.

examples/new_read.rs Outdated Show resolved Hide resolved
examples/new_read.rs Outdated Show resolved Hide resolved
src/buffer.rs Outdated Show resolved Hide resolved
src/fs/inotify.rs Outdated Show resolved Hide resolved
@sunfishcode sunfishcode mentioned this pull request Jan 27, 2025
21 tasks
@sunfishcode sunfishcode added the semver bump Issues that will require a semver-incompatible fix label Jan 30, 2025
src/buffer.rs Show resolved Hide resolved
src/buffer.rs Outdated Show resolved Hide resolved
I'm experimenting with a `Buffer` trait similar to #908, however I've
run into a few problems. See the questions in examples/new_read.rs for
details.
`Extend` now returns a `usize` to make it easier to test for
end-of-stream.
@sunfishcode sunfishcode force-pushed the sunfishcode/new-read branch 2 times, most recently from 8b4cee0 to f2eaa94 Compare February 4, 2025 12:34
@SUPERCILEX
Copy link
Contributor

Looking at our APIs, I think we'd want to consider adding uninit methods to roughly these methods (the filtering is not great, sorry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver bump Issues that will require a semver-incompatible fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants