pub struct CompressedBody<InnerBody, CompressionImpl> { /* private fields */ }Expand description
A Body that may compress its data with a CompressRequest implementor.
Compression options may disable request compression for small data payload, or entirely. Additionally, some services may not support compression.
Implementations§
Source§impl CompressedBody<SdkBody, Box<dyn CompressRequest>>
 
impl CompressedBody<SdkBody, Box<dyn CompressRequest>>
Sourcepub fn into_compressed_sdk_body(self) -> Result<SdkBody, BoxError>
 
pub fn into_compressed_sdk_body(self) -> Result<SdkBody, BoxError>
Consumes this CompressedBody and returns an [SdkBody] containing the compressed data.
This requires that the inner SdkBody is in-memory (i.e. not streaming). Otherwise, an error is returned.
If compression fails, an error is returned.
Source§impl<CR> CompressedBody<SdkBody, CR>
 
impl<CR> CompressedBody<SdkBody, CR>
Trait Implementations§
Source§impl Body for CompressedBody<SdkBody, Box<dyn CompressRequest>>
 
impl Body for CompressedBody<SdkBody, Box<dyn CompressRequest>>
Source§fn poll_data(
    self: Pin<&mut Self>,
    cx: &mut Context<'_>,
) -> Poll<Option<Result<Self::Data, Self::Error>>>
 
fn poll_data( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Option<Result<Self::Data, Self::Error>>>
Attempt to pull out the next data buffer of this stream.
Source§fn poll_trailers(
    self: Pin<&mut Self>,
    cx: &mut Context<'_>,
) -> Poll<Result<Option<HeaderMap>, Self::Error>>
 
fn poll_trailers( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<Option<HeaderMap>, Self::Error>>
Poll for an optional single 
HeaderMap of trailers. Read moreSource§fn is_end_stream(&self) -> bool
 
fn is_end_stream(&self) -> bool
Returns 
true when the end of stream has been reached. Read moreSource§fn size_hint(&self) -> SizeHint
 
fn size_hint(&self) -> SizeHint
Returns the bounds on the remaining length of the stream. Read more
Source§fn trailers(&mut self) -> Trailers<'_, Self>
 
fn trailers(&mut self) -> Trailers<'_, Self>
Returns future that resolves to trailers, if any.
Source§fn map_data<F, B>(self, f: F) -> MapData<Self, F>
 
fn map_data<F, B>(self, f: F) -> MapData<Self, F>
Maps this body’s data value to a different value.
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 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 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§impl Body for CompressedBody<SdkBody, Box<dyn CompressRequest>>
 
impl Body for CompressedBody<SdkBody, Box<dyn CompressRequest>>
impl<'__pin, InnerBody, CompressionImpl> Unpin for CompressedBody<InnerBody, CompressionImpl>where
    PinnedFieldsOf<__Origin<'__pin, InnerBody, CompressionImpl>>: Unpin,
Auto Trait Implementations§
impl<InnerBody, CompressionImpl> Freeze for CompressedBody<InnerBody, CompressionImpl>
impl<InnerBody, CompressionImpl> RefUnwindSafe for CompressedBody<InnerBody, CompressionImpl>where
    InnerBody: RefUnwindSafe,
    CompressionImpl: RefUnwindSafe,
impl<InnerBody, CompressionImpl> Send for CompressedBody<InnerBody, CompressionImpl>
impl<InnerBody, CompressionImpl> Sync for CompressedBody<InnerBody, CompressionImpl>
impl<InnerBody, CompressionImpl> UnwindSafe for CompressedBody<InnerBody, CompressionImpl>where
    InnerBody: UnwindSafe,
    CompressionImpl: UnwindSafe,
Blanket Implementations§
§impl<T> BodyExt for Twhere
    T: Body + ?Sized,
 
impl<T> BodyExt for Twhere
    T: Body + ?Sized,
§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.§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.
§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.§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
§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
§impl<T> Instrument for T
 
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
 
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreCreates a shared type from an unshared type.