pub struct TrackedBody<B, T> { /* private fields */ }
Expand description
A wrapper around an HTTP body that tracks the size of the data that is read from it.
Implementations§
Source§impl<B, T> TrackedBody<B, T>
impl<B, T> TrackedBody<B, T>
Sourcepub fn new(body: B, tracker: T) -> Self
pub fn new(body: B, tracker: T) -> Self
Create a new TrackedBody
with the given body and tracker.
Trait Implementations§
Source§impl<B, T> Body for TrackedBody<B, T>where
B: Body,
T: Tracker,
impl<B, T> Body for TrackedBody<B, T>where
B: Body,
T: Tracker,
Source§type Error = TrackedBodyError<B, T>
type Error = TrackedBodyError<B, T>
The error type this
Body
might generate.Source§fn poll_frame(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>>
fn poll_frame( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>>
Attempt to pull out the next data buffer of this stream.
Source§fn is_end_stream(&self) -> bool
fn is_end_stream(&self) -> bool
Returns
true
when the end of stream has been reached. Read moreimpl<'__pin, B, T> Unpin for TrackedBody<B, T>where
PinnedFieldsOf<__Origin<'__pin, B, T>>: Unpin,
Auto Trait Implementations§
impl<B, T> Freeze for TrackedBody<B, T>
impl<B, T> RefUnwindSafe for TrackedBody<B, T>where
B: RefUnwindSafe,
T: RefUnwindSafe,
impl<B, T> Send for TrackedBody<B, T>
impl<B, T> Sync for TrackedBody<B, T>
impl<B, T> UnwindSafe for TrackedBody<B, T>where
B: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more