pub struct CaptureBody<B, S>{ /* private fields */ }Expand description
A body that asynchronously sends an owned copy of each frame to a sink.
At most one original frame and its reference-counted capture copy are retained while the sink future is pending. No whole-body buffering or internal channel is used.
Implementations§
Source§impl<B, S> CaptureBody<B, S>
impl<B, S> CaptureBody<B, S>
Sourcepub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut B>
pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut B>
Return a pinned mutable reference to the wrapped body.
Sourcepub fn into_inner(self) -> B
pub fn into_inner(self) -> B
Consume the wrapper and return the inner body.
The sink receives BodyCaptureSink::aborted.
Source§impl<B> CaptureBody<B, BufferedBodyCapture>where
B: StreamingBody<Data = Bytes>,
impl<B> CaptureBody<B, BufferedBodyCapture>where
B: StreamingBody<Data = Bytes>,
Sourcepub fn buffered(inner: B, limit: CaptureLimit) -> (Self, CaptureHandle)
pub fn buffered(inner: B, limit: CaptureLimit) -> (Self, CaptureHandle)
Wrap a body and retain a bounded or unlimited copy in memory.
Trait Implementations§
Source§impl<B, S> Body for CaptureBody<B, S>
impl<B, S> Body for CaptureBody<B, S>
Source§impl<B, S> Debug for CaptureBody<B, S>
impl<B, S> Debug for CaptureBody<B, S>
impl<'__pin, B, S> Unpin for CaptureBody<B, S>where
PinnedFieldsOf<__Origin<'__pin, B, S>>: Unpin,
B: StreamingBody<Data = Bytes>,
S: BodyCaptureSink,
Auto Trait Implementations§
impl<B, S> !Freeze for CaptureBody<B, S>
impl<B, S> !RefUnwindSafe for CaptureBody<B, S>
impl<B, S> !UnwindSafe for CaptureBody<B, S>
impl<B, S> Send for CaptureBody<B, S>
impl<B, S> Sync for CaptureBody<B, S>
impl<B, S> UnsafeUnpin for CaptureBody<B, S>where
B: UnsafeUnpin,
CaptureGuard<S>: UnsafeUnpin,
Option<PendingOutput<<B as Body>::Error>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BodyExt for T
impl<T> BodyExt for T
Source§fn frame(&mut self) -> Frame<'_, Self> ⓘwhere
Self: Unpin,
fn frame(&mut self) -> Frame<'_, Self> ⓘwhere
Self: Unpin,
Returns a future that resolves to the next
Frame, if any.Source§fn map_frame<F, B>(self, f: F) -> MapFrame<Self, F>
fn map_frame<F, B>(self, f: F) -> MapFrame<Self, F>
Maps this body’s frame to a different kind.
Source§fn inspect_frame<F>(self, f: F) -> InspectFrame<Self, F>
fn inspect_frame<F>(self, f: F) -> InspectFrame<Self, F>
A body that calls a function with a reference to each frame before yielding it.
Source§fn capture<S>(self, sink: S) -> CaptureBody<Self, S>
fn capture<S>(self, sink: S) -> CaptureBody<Self, S>
Forward this byte body while asynchronously sending owned frame copies to a sink.
Source§fn capture_buffered(
self,
limit: CaptureLimit,
) -> (CaptureBody<Self, BufferedBodyCapture>, CaptureHandle)
fn capture_buffered( self, limit: CaptureLimit, ) -> (CaptureBody<Self, BufferedBodyCapture>, CaptureHandle)
Forward this byte body while retaining a bounded or unlimited copy in memory.
Source§fn map_err<F, E>(self, f: F) -> MapErr<Self, F>
fn map_err<F, E>(self, f: F) -> MapErr<Self, F>
Maps this body’s error value to a different value.
Source§fn inspect_err<F>(self, f: F) -> InspectErr<Self, F>
fn inspect_err<F>(self, f: F) -> InspectErr<Self, F>
A body that calls a function with a reference to an error before yielding it.
Source§fn boxed_unsync(self) -> UnsyncBoxBody<Self::Data, Self::Error>
fn boxed_unsync(self) -> UnsyncBoxBody<Self::Data, Self::Error>
Turn this body into a boxed trait object that is !Sync.
Source§fn collect_with(self, opts: CollectOptions) -> CollectWith<Self> ⓘ
fn collect_with(self, opts: CollectOptions) -> CollectWith<Self> ⓘ
Collect this body, but bounded by the size cap and/or timeout in
CollectOptions. Read moreSource§fn with_trailers<F>(self, trailers: F) -> WithTrailers<Self, F>
fn with_trailers<F>(self, trailers: F) -> WithTrailers<Self, F>
Add trailers to the body. Read more
Source§fn into_data_stream(self) -> BodyDataStream<Self>where
Self: Sized,
fn into_data_stream(self) -> BodyDataStream<Self>where
Self: Sized,
Turn this body into
BodyDataStream.Source§fn into_stream(self) -> BodyStream<Self>where
Self: Sized,
fn into_stream(self) -> BodyStream<Self>where
Self: Sized,
Turn this body into
BodyStream. Read moreSource§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more