Feature-gated SdkBody
and ByteStream
creation upgrade guidance
#3089
ysaito1001
announced in
Change Log
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If you do not currently depend on any of the following:
SdkBody::from_dyn
impl From<hyper::Body> for SdkBody
impl From<hyper::Body> for ByteStream
then you can stop reading this guide now since you won't be impacted by these changes.
This guide assumes that
SdkBody
andByteStream
have been moved toaws-smithy-types
fromaws-smithy-http
(as a result of #3026).Previously, the said methods publicly exposed third-party types of unstable crates. To anticipate the need for supporting equivalent functionality with 1.x of those crates in the future, we now feature-gate the exposed types so customers opt-in to use them, which then allows us to add support for 1.x of those crates in a backwards compatible fashion.
Upgrading
SdkBody::from_dyn
Wherever
SdkBody
is created withfrom_dyn
, you can turn on a cargo featurehttp-body-0-4-x
withinaws-smithy-types
and useSdkBody::from_body_0_4
instead.Upgrading
impl From<hyper::Body> for SdkBody
SdkBody::from(hyper::Body)
(orhyper::Body::into(self) -> SdkBody
), then you can turn on a cargo featurehttp-body-0-4-x
withinaws-smithy-types
and useSdkBody::from_body_0_4
instead.impl From<hyper::Body>
, then you can turn on bothhttp-body-0-4-x
andhyper-0-14-x
cargo features withinaws-smithy-types
to enable theFrom<hyper_0_14::Body> for SdkBody
.Upgrading
impl From<hyper::Body> for ByteStream
ByteStream::from(hyper::Body)
(orhyper::Body::into(self) -> ByteStream
), then you can turn on a cargo featurehttp-body-0-4-x
withinaws-smithy-types
and useByteStream::from_body_0_4
instead.impl From<hyper::Body>
, then you can turn on bothhttp-body-0-4-x
andhyper-0-14-x
cargo features withinaws-smithy-types
to enable theFrom<hyper_0_14::Body> for ByteStream
.Recommended practice
Most importantly, if you generate the SDK for a service,
ByteStream
andSdkBody
are reexported from a module calledprimitives
. You should use those reexported ones instead of directly using them fromaws-smithy-types
.Beta Was this translation helpful? Give feedback.
All reactions