Skip to content

Unseal Buffer trait #1463

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

Open
morbridge opened this issue May 15, 2025 · 1 comment
Open

Unseal Buffer trait #1463

morbridge opened this issue May 15, 2025 · 1 comment

Comments

@morbridge
Copy link

Hi!

I find Buffer trait and SpareCapacity quite nice. But having the trait sealed is quite limiting.

Any plans to unseal the the trait so it can be used for own buffer types and own read-like methods? Are the internals too unstable? Would this have any memory safety issues?

I think tokio, bytes, async-std could use this technique too (although, I'm not sure if it's okay for them to depend on rustix)

@sunfishcode
Copy link
Member

I've been experimenting with the Buffer trait in a standalone buffer-trait crate, which has an unsealed trait and a more complete API.

Crates like bytes probably won't ever want a dependency on rustix, so buffer-trait is the more likely path forward here. If buffer-trait becomes popular, perhaps rustix should switch to it too.

Also, there has been some interest in the Buffer trait from some Rust folks, as a possible alternative to BorrowedBuf, though there isn't yet an RFC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants