pub struct TranscodingBody<InnerBodyT>{ /* private fields */ }
Expand description
Body wrapper that can encode, decode, or pass through.
Note that the resulting number (and of course sizes) of the data frames will not necessarily match those of the wrapped body.
Relies on TranscodingReader.
Implementations§
Source§impl<InnerBodyT> TranscodingBody<InnerBodyT>
impl<InnerBodyT> TranscodingBody<InnerBodyT>
Sourcepub fn new(reader: TranscodingReader<BodyReader<InnerBodyT>>) -> Self
pub fn new(reader: TranscodingReader<BodyReader<InnerBodyT>>) -> Self
Constructor.
Trait Implementations§
Source§impl<InnerBodyT> Body for TranscodingBody<InnerBodyT>
impl<InnerBodyT> Body for TranscodingBody<InnerBodyT>
Source§impl<BodyT> From<Bytes> for TranscodingBody<BodyT>
impl<BodyT> From<Bytes> for TranscodingBody<BodyT>
impl<'pin, InnerBodyT> Unpin for TranscodingBody<InnerBodyT>where
InnerBodyT: Body,
InnerBodyT::Error: Into<CapturedError>,
PinnedFieldsOf<__TranscodingBody<'pin, InnerBodyT>>: Unpin,
Auto Trait Implementations§
impl<InnerBodyT> Freeze for TranscodingBody<InnerBodyT>
impl<InnerBodyT> RefUnwindSafe for TranscodingBody<InnerBodyT>
impl<InnerBodyT> Send for TranscodingBody<InnerBodyT>
impl<InnerBodyT> Sync for TranscodingBody<InnerBodyT>
impl<InnerBodyT> !UnwindSafe for TranscodingBody<InnerBodyT>
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 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 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(self) -> Collect<Self>where
Self: Sized,
fn collect(self) -> Collect<Self>where
Self: Sized,
Turn this body into
Collected
body which will collect all the DATA frames
and trailers.Source§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§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
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<BodyT> IntoBodyReader<BodyT> for BodyT
impl<BodyT> IntoBodyReader<BodyT> for BodyT
Source§fn into_reader_with_first_bytes(
self,
first_bytes: Option<Bytes>,
) -> BodyReader<BodyT>
fn into_reader_with_first_bytes( self, first_bytes: Option<Bytes>, ) -> BodyReader<BodyT>
Into BodyReader.
Source§fn into_reader(self) -> BodyReader<BodyT>
fn into_reader(self) -> BodyReader<BodyT>
Into BodyReader.
Source§impl<BodyT> IntoTranscodingBody<BodyT> for BodyT
impl<BodyT> IntoTranscodingBody<BodyT> for BodyT
Source§fn into_transcoding_passthrough_with_first_bytes(
self,
first_bytes: Option<Bytes>,
) -> TranscodingBody<BodyT>
fn into_transcoding_passthrough_with_first_bytes( self, first_bytes: Option<Bytes>, ) -> TranscodingBody<BodyT>
Into passthrough TranscodingBody.
Source§fn into_encoding_with_first_bytes(
self,
first_bytes: Option<Bytes>,
encoding: &Encoding,
) -> TranscodingBody<BodyT>
fn into_encoding_with_first_bytes( self, first_bytes: Option<Bytes>, encoding: &Encoding, ) -> TranscodingBody<BodyT>
Into encoding TranscodingBody.
Source§fn into_decoding_with_first_bytes(
self,
first_bytes: Option<Bytes>,
encoding: &Encoding,
) -> TranscodingBody<BodyT>
fn into_decoding_with_first_bytes( self, first_bytes: Option<Bytes>, encoding: &Encoding, ) -> TranscodingBody<BodyT>
Into decoding TranscodingBody.
Source§fn into_transcoding_passthrough(self) -> TranscodingBody<BodyT>
fn into_transcoding_passthrough(self) -> TranscodingBody<BodyT>
Into passthrough TranscodingBody.
Source§fn into_encoding(self, encoding: &Encoding) -> TranscodingBody<BodyT>
fn into_encoding(self, encoding: &Encoding) -> TranscodingBody<BodyT>
Into encoding TranscodingBody.
Source§fn into_decoding(self, encoding: &Encoding) -> TranscodingBody<BodyT>
fn into_decoding(self, encoding: &Encoding) -> TranscodingBody<BodyT>
Into decoding TranscodingBody.