Skip to content

Commit 30db493

Browse files
committed
https://github.com/hyperium/http-body/pull/90
1 parent 930f1a2 commit 30db493

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/lib.rs

+14
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,20 @@ pub trait Body {
5858
cx: &mut Context<'_>,
5959
) -> Poll<Option<Result<Self::Data, Self::Error>>>;
6060

61+
/// Attempt to progress the body's state without pulling a new frame.
62+
///
63+
/// `Body` consumers can use this method to allow the `Body` implementation to continue to
64+
/// perform work even when the consumer is not yet ready to read the next frame. For example,
65+
/// a `Body` implementation could maintain a timer counting down between `poll_data` calls and
66+
/// report an error from `poll_progress` when time expires.
67+
///
68+
/// Consumers are *not* required to call this method. A `Body` implementation should not depend
69+
/// on calls to `poll_progress` to occur.
70+
fn poll_progress(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
71+
let _ = cx;
72+
Poll::Ready(Ok(()))
73+
}
74+
6175
/// Poll for an optional **single** `HeaderMap` of trailers.
6276
///
6377
/// This function should only be called once `poll_data` returns `None`.

0 commit comments

Comments
 (0)