hyper_utils/http_body_util/combinators/
frame.rs1use core::{future::Future, pin::Pin, task};
2
3use hyper::body::Body;
4
5#[must_use = "futures don't do anything unless polled"]
6#[derive(Debug)]
7pub struct Frame<'a, T: ?Sized>(pub(crate) &'a mut T);
9
10impl<'a, T: Body + Unpin + ?Sized> Future for Frame<'a, T> {
11 type Output = Option<Result<hyper::body::Frame<T::Data>, T::Error>>;
12
13 fn poll(mut self: Pin<&mut Self>, ctx: &mut task::Context<'_>) -> task::Poll<Self::Output> {
14 Pin::new(&mut self.0).poll_frame(ctx)
15 }
16}