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

Is it able to support implement Body for h2::RecvStream in crate? #54

Open
ethe opened this issue Dec 11, 2021 · 1 comment
Open

Is it able to support implement Body for h2::RecvStream in crate? #54

ethe opened this issue Dec 11, 2021 · 1 comment

Comments

@ethe
Copy link

ethe commented Dec 11, 2021

I think it is convenient if implementing Body for h2::RecvStreamBody as default, because we get http::Request<h2::RecvStream> when we use h2 to handle HTTP2 requests.

impl Body for h2::RecvStream {
    type Data = Bytes;
    type Error = h2::Error;

    fn poll_data(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
    ) -> Poll<Option<Result<Self::Data, Self::Error>>> {
        return self.poll_data(cx);
    }

    fn poll_trailers(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
    ) -> Poll<Result<Option<HeaderMap>, Self::Error>> {
        return self.poll_trailers(cx);
    }
}
@LucioFranco
Copy link
Member

This issue seems to be better in the h2 repo rather than in this one?

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