Skip to content

Commit

Permalink
https://github.com/hyperium/http-body/pull/90
Browse files Browse the repository at this point in the history
  • Loading branch information
olix0r committed Mar 6, 2024
1 parent 930f1a2 commit 30db493
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ pub trait Body {
cx: &mut Context<'_>,
) -> Poll<Option<Result<Self::Data, Self::Error>>>;

/// Attempt to progress the body's state without pulling a new frame.
///
/// `Body` consumers can use this method to allow the `Body` implementation to continue to
/// perform work even when the consumer is not yet ready to read the next frame. For example,
/// a `Body` implementation could maintain a timer counting down between `poll_data` calls and
/// report an error from `poll_progress` when time expires.
///
/// Consumers are *not* required to call this method. A `Body` implementation should not depend
/// on calls to `poll_progress` to occur.
fn poll_progress(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
let _ = cx;
Poll::Ready(Ok(()))
}

/// Poll for an optional **single** `HeaderMap` of trailers.
///
/// This function should only be called once `poll_data` returns `None`.
Expand Down

0 comments on commit 30db493

Please sign in to comment.