Skip to content

Commit 4e2d65e

Browse files
committed
feat(http/retry): ForwardCompatibleBody<B> exposes hints
this commit removes the `cfg(test)` gate on the method exposing `B::is_end_stream()`, and introduces another method also exposing the `size_hint()` method. we will want these in order to implement these methods for `ReplayBody<B>`. Signed-off-by: katelyn martin <kate@buoyant.io>
1 parent 93e9805 commit 4e2d65e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

linkerd/http/retry/src/compat.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Compatibility utilities for upgrading to http-body 1.0.
22
3-
use http_body::Body;
3+
use http_body::{Body, SizeHint};
44

55
pub(crate) use self::frame::Frame;
66

@@ -42,10 +42,16 @@ impl<B: Body> ForwardCompatibleBody<B> {
4242
}
4343

4444
/// Returns `true` when the end of stream has been reached.
45-
#[cfg(test)]
45+
#[allow(unused, reason = "not yet used")]
4646
pub(crate) fn is_end_stream(&self) -> bool {
4747
self.inner.is_end_stream()
4848
}
49+
50+
/// Returns the bounds on the remaining length of the stream.
51+
#[allow(unused, reason = "not yet used")]
52+
pub(crate) fn size_hint(&self) -> SizeHint {
53+
self.inner.size_hint()
54+
}
4955
}
5056

5157
/// Future that resolves to the next frame from a `Body`.

0 commit comments

Comments
 (0)