-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove
futures_core::stream::Stream
from `aws_smithy_http::byte_str…
…eam::ByteStream` (#2983) ## Motivation and Context Removes `futures_core::stream::Stream` from `aws_smithy_http::byte_stream::ByteStream` ## Description This PR is part of our ongoing effort, #2413. We remove the `futures_core::stream::Stream` trait from `aws_smithy_http::byte_stream::ByteStream`. To continue support existing places that relied upon `ByteStream` implementing the `Stream` trait, we provide explicit `.next`, `.try_next`, and `.size_hints` methods on that type. As part of it, a doc-hidden type `FuturesStreamCompatByteStream`, which implements `Stream`, has been added to `aws_smithy_http` to cater to those who need a type implementing `Stream` (see [discussion](#2910 (comment)) why doc-hidden). Another place we need to update is codegen responsible for rendering stream payload serializer, and this affects the server. The regular server and the python server have slightly different rendering requirements, since the former uses `aws_smithy_http::byte_stream::ByteStream` (that does _not_ implement the `Stream` trait) and latter uses its own [ByteStream](https://github.com/awslabs/smithy-rs/blob/cb79a68e3c38d1e62d3980d5e7baedc1144bacc7/rust-runtime/aws-smithy-http-server-python/src/types.rs#L343) (that does implement `Stream`). We use `ServerHttpBoundProtocolCustomization` to handle the difference: `StreamPayloadSerializerCustomization` and `PythonServerStreamPayloadSerializerCustomization`. ## Testing No new behavior has been added, relied on the existing tests in CI. ## Checklist - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates - [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS SDK, generated SDK code, or SDK runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
- Loading branch information
1 parent
bc41828
commit 33cd698
Showing
11 changed files
with
254 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.