File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff 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`.
You can’t perform that action at this time.
0 commit comments