File tree 1 file changed +7
-3
lines changed 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -49,17 +49,21 @@ pub trait Body {
49
49
cx : & mut Context < ' _ > ,
50
50
) -> Poll < Option < Result < Frame < Self :: Data > , Self :: Error > > > ;
51
51
52
- /// Returns `true` when the end of stream has been reached.
52
+ /// A hint that may return `true` when the end of stream has been reached.
53
53
///
54
54
/// An end of stream means that `poll_frame` will return `None`.
55
55
///
56
56
/// A return value of `false` **does not** guarantee that a value will be
57
- /// returned from `poll_frame`.
57
+ /// returned from `poll_frame`. Combinators or other implementations may
58
+ /// not be able to know the end of stream has been reached for this hint.
59
+ ///
60
+ /// Returning `true` allows consumers of this body to optimize, such as not
61
+ /// calling `poll_frame` again.
58
62
fn is_end_stream ( & self ) -> bool {
59
63
false
60
64
}
61
65
62
- /// Returns the bounds on the remaining length of the stream.
66
+ /// A hint that returns the bounds on the remaining length of the stream.
63
67
///
64
68
/// When the **exact** remaining length of the stream is known, the upper bound will be set and
65
69
/// will equal the lower bound.
You can’t perform that action at this time.
0 commit comments