Struct aws_smithy_compression::body::compress::CompressedBody
source · 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>
Available on crate feature http-body-0-4-x
only.
pub fn into_compressed_sdk_body(self) -> Result<SdkBody, BoxError>
http-body-0-4-x
only.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.
Trait Implementations§
source§impl Body for CompressedBody<SdkBody, Box<dyn CompressRequest>>
Available on crate feature http-body-0-4-x
only.
impl Body for CompressedBody<SdkBody, Box<dyn CompressRequest>>
Available on crate feature
http-body-0-4-x
only.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>>
Available on crate feature http-body-1-x
only.
impl Body for CompressedBody<SdkBody, Box<dyn CompressRequest>>
Available on crate feature
http-body-1-x
only.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.