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

AsyncRead: read with a library-provided buffer #15

Open
nrc opened this issue Feb 15, 2023 · 2 comments
Open

AsyncRead: read with a library-provided buffer #15

nrc opened this issue Feb 15, 2023 · 2 comments
Labels
A-stdlib Area: a standard library for async Rust

Comments

@nrc
Copy link
Owner

nrc commented Feb 15, 2023

To use io_uring's buffer pools, I think we need a method of reading which lets the library manage a buffer pool and reading to return a buffer without the caller providing one. I'm not sure what the work flow between concrete and abstract types looks like here, or what exactly should be returned (&[u8]? OwnedBuf? An associated type?).

@nrc nrc added the A-stdlib Area: a standard library for async Rust label Feb 15, 2023
@NobodyXu
Copy link

What about an erased type contains a v-table?

I don't think it can return &[u8] since the io-uring managed buffer pool cannot have lifetime &'static and it also needs a Drop::drop impl to recycle the buffer.

@Noah-Kennedy
Copy link

This has been the direction I've been thinking about as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stdlib Area: a standard library for async Rust
Projects
None yet
Development

No branches or pull requests

3 participants