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

tokio_util::io::poll_read_buf does not work with ?Sized type. #6429

Closed
fakeshadow opened this issue Mar 25, 2024 · 1 comment · Fixed by #6441
Closed

tokio_util::io::poll_read_buf does not work with ?Sized type. #6429

fakeshadow opened this issue Mar 25, 2024 · 1 comment · Fixed by #6441
Labels
A-tokio-util Area: The tokio-util crate C-feature-request Category: A feature request. M-io Module: tokio/io

Comments

@fakeshadow
Copy link

Is your feature request related to a problem? Please describe.
For given case said api does not work.

fn poll_read(
    io: &mut (dyn tokio::io::AsyncRead + Unpin),
    cx: &mut std::task::Context<'_>,
    buf: &mut impl bytes::BufMut,
) {
    tokio_util::io::poll_read_buf(std::pin::Pin::new(io), cx, buf);
}

Describe the solution you'd like
add ?Sized bound.

Additional context
I recall at some point the function has ?Sized bound but have no idea when or why it's removed.

@fakeshadow fakeshadow added A-tokio Area: The main tokio crate C-feature-request Category: A feature request. labels Mar 25, 2024
@Darksonn Darksonn added A-tokio-util Area: The tokio-util crate M-io Module: tokio/io and removed A-tokio Area: The main tokio crate labels Mar 26, 2024
@Darksonn
Copy link
Contributor

Thanks, adding ?Sized sounds like a good idea.

I recall at some point the function has ?Sized bound but have no idea when or why it's removed.

I'm pretty sure it has always been the way it is now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-util Area: The tokio-util crate C-feature-request Category: A feature request. M-io Module: tokio/io
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants