Skip to content

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

@ethe

Description

@ethe

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);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions