Unverified Commit 0f38daea authored by ysaito1001's avatar ysaito1001 Committed by GitHub
Browse files

Move `SdkBody` and `bytestream` into `aws-smithy-types` (#3026)

## Motivation and Context
Takes care of the first part of
https://github.com/awslabs/smithy-rs/issues/3053 (the remaining part is
denoted as `TODO(runtimeCratesVersioningCleanup)` and until that and
https://github.com/awslabs/smithy-rs/issues/3033 are done the issue will
not be closed).

## Description
This PR moves from `aws-smithy-http` to `aws-smithy-types`:
- the `SdkBody` struct
- the `byte_stream` module

Within the origin crate, we leave "breadcrumbs" (i.e. reexports) for
existing customers of the items above so they are not broken by the
move.

We have just moved `SdkBody` to `aws-smithy-types` without renaming it
to see how it looks there. However, as
[TODO(naming)](https://github.com/awslabs/smithy-rs/pull/3026/files#diff-090c503b779024fdadb8ac97465c80438635df82e62c42b0d85b588a303d9a95R28

)
says, we can choose to rename it to just `Body`. Curious to hear what
the reviewers think.

## Testing
Relied on the tests in CI.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

---------

Co-authored-by: default avatarRussell Cohen <rcoh@amazon.com>
parent 3ab5a692
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ allowed_external_types = [
   "aws_smithy_async::rt::sleep::SharedAsyncSleep",
   "aws_smithy_async::time::SharedTimeSource",
   "aws_smithy_async::time::TimeSource",
   "aws_smithy_http::body::SdkBody",
   "aws_smithy_types::body::SdkBody",
   "aws_smithy_http::endpoint",
   "aws_smithy_http::endpoint::error::InvalidEndpointError",
   "aws_smithy_http::result::SdkError",
+1 −1
Original line number Diff line number Diff line
allowed_external_types = [
    "aws_smithy_http::body::Error",
    "aws_smithy_types::body::Error",
    "aws_smithy_types::config_bag::storable::Storable",
    "aws_smithy_types::config_bag::storable::StoreReplace",
    "aws_types::app_name::AppName",
+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ allowed_external_types = [
    "aws_sigv4::http_request::sign::SignableBody",
    "aws_sigv4::http_request::error::SigningError",
    "aws_smithy_http::*",
    "aws_smithy_types::body::SdkBody",
    "aws_types::*",
    "http::request::Request",
    "aws_smithy_runtime_api::client::identity::Identity",
+1 −1
Original line number Diff line number Diff line
allowed_external_types = [
    "aws_smithy_http::*",
    "aws_smithy_types::body::SdkBody",
    "bytes::bytes::Bytes",
    "http::header::map::HeaderMap",
    "http::header::name::HeaderName",
+2 −13
Original line number Diff line number Diff line
@@ -11,8 +11,8 @@ license = "Apache-2.0"
repository = "https://github.com/awslabs/smithy-rs"

[features]
rt-tokio = ["dep:tokio-util", "dep:tokio", "tokio?/rt", "tokio?/fs", "tokio?/io-util", "tokio-util?/io"]
event-stream = ["aws-smithy-eventstream"]
rt-tokio = ["aws-smithy-types/rt-tokio"]

[dependencies]
aws-smithy-eventstream = { path = "../aws-smithy-eventstream", optional = true }
@@ -27,30 +27,19 @@ pin-project-lite = "0.2.9"
pin-utils = "0.1.0"
tracing = "0.1"

# We are using hyper for our streaming body implementation, but this is an internal detail.
hyper = "0.14.26"

# ByteStream internals
# For an adapter to enable the `Stream` trait for `aws_smithy_types::byte_stream::ByteStream`
futures-core = "0.3.14"
tokio = { version = "1.23.1", optional = true }
tokio-util = { version = "0.7", optional = true }

[dev-dependencies]
async-stream = "0.3"
futures-util = { version = "0.3.16", default-features = false }
hyper = { version = "0.14.26", features = ["stream"] }
pretty_assertions = "1.3"
proptest = "1"
tokio = { version = "1.23.1", features = [
  "macros",
  "rt",
  "rt-multi-thread",
  "fs",
  "io-util",
] }
tokio-stream = "0.1.5"
tempfile = "3.2.0"
tracing-test = "0.2.1"

[package.metadata.docs.rs]
all-features = true
Loading