File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,20 @@ pub trait Body {
58
58
cx : & mut Context < ' _ > ,
59
59
) -> Poll < Option < Result < Self :: Data , Self :: Error > > > ;
60
60
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
+
61
75
/// Poll for an optional **single** `HeaderMap` of trailers.
62
76
///
63
77
/// This function should only be called once `poll_data` returns `None`.
You can’t perform that action at this time.
0 commit comments