From 9db2a737c4a218fb6b988f19fda5e2be3dc8c600 Mon Sep 17 00:00:00 2001 From: AWS SDK Rust Bot Date: Fri, 13 May 2022 17:56:33 +0000 Subject: [PATCH] Update changelogs --- CHANGELOG.md | 52 ++++++++++++++++++++++++++++++++++ CHANGELOG.next.toml | 67 +------------------------------------------- aws/SDK_CHANGELOG.md | 6 ++++ 3 files changed, 59 insertions(+), 66 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23aa146ccf..032f195b45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,56 @@ +v0.42.0 (May 13th, 2022) +======================== +**Breaking Changes:** +- ⚠🎉 ([aws-sdk-rust#494](https://github.com/awslabs/aws-sdk-rust/issues/494), [aws-sdk-rust#519](https://github.com/awslabs/aws-sdk-rust/issues/519)) The `aws_smithy_http::byte_stream::bytestream_util::FsBuilder` has been updated to allow for easier creation of + multi-part requests. + + - `FsBuilder::offset` is a new method allowing users to specify an offset to start reading a file from. + - `FsBuilder::file_size` has been reworked into `FsBuilder::length` and is now used to specify the amount of data to read. + + With these two methods, it's now simple to create a `ByteStream` that will read a single "chunk" of a file. The example + below demonstrates how you could divide a single `File` into consecutive chunks to create multiple `ByteStream`s. + + ```rust + let example_file_path = Path::new("/example.txt"); + let example_file_size = tokio::fs::metadata(&example_file_path).await.unwrap().len(); + let chunks = 6; + let chunk_size = file_size / chunks; + let mut byte_streams = Vec::new(); + + for i in 0..chunks { + let length = if i == chunks - 1 { + // If we're on the last chunk, the length to read might be less than a whole chunk. + // We substract the size of all previous chunks from the total file size to get the + // size of the final chunk. + file_size - (i * chunk_size) + } else { + chunk_size + }; + + let byte_stream = ByteStream::read_from() + .path(&file_path) + .offset(i * chunk_size) + .length(length) + .build() + .await?; + + byte_streams.push(byte_stream); + } + + for chunk in byte_streams { + // Make requests to a service + } + ``` + +**New this release:** +- ([smithy-rs#1352](https://github.com/awslabs/smithy-rs/issues/1352)) Log a debug event when a retry is going to be peformed +- ([smithy-rs#1332](https://github.com/awslabs/smithy-rs/issues/1332), @82marbag) Update generated crates to Rust 2021 + +**Contributors** +Thank you for your contributions! ❤ +- @82marbag ([smithy-rs#1332](https://github.com/awslabs/smithy-rs/issues/1332)) + 0.41.0 (April 28th, 2022) ========================= **Breaking Changes:** diff --git a/CHANGELOG.next.toml b/CHANGELOG.next.toml index 7806444291..1dffbf7f63 100644 --- a/CHANGELOG.next.toml +++ b/CHANGELOG.next.toml @@ -9,69 +9,4 @@ # message = "Fix typos in module documentation for generated crates" # references = ["smithy-rs#920"] # meta = { "breaking" = false, "tada" = false, "bug" = false } -# author = "rcoh" - -[[aws-sdk-rust]] -message = "Log a debug event when a retry is going to be peformed" -references = ["smithy-rs#1352"] -meta = { "breaking" = false, "tada" = false, "bug" = false } -author = "jdisanti" - -[[smithy-rs]] -message = "Log a debug event when a retry is going to be peformed" -references = ["smithy-rs#1352"] -meta = { "breaking" = false, "tada" = false, "bug" = false } -author = "jdisanti" - -[[smithy-rs]] -message = """ -The `aws_smithy_http::byte_stream::bytestream_util::FsBuilder` has been updated to allow for easier creation of -multi-part requests. - -- `FsBuilder::offset` is a new method allowing users to specify an offset to start reading a file from. -- `FsBuilder::file_size` has been reworked into `FsBuilder::length` and is now used to specify the amount of data to read. - -With these two methods, it's now simple to create a `ByteStream` that will read a single "chunk" of a file. The example -below demonstrates how you could divide a single `File` into consecutive chunks to create multiple `ByteStream`s. - -```rust -let example_file_path = Path::new("/example.txt"); -let example_file_size = tokio::fs::metadata(&example_file_path).await.unwrap().len(); -let chunks = 6; -let chunk_size = file_size / chunks; -let mut byte_streams = Vec::new(); - -for i in 0..chunks { - let length = if i == chunks - 1 { - // If we're on the last chunk, the length to read might be less than a whole chunk. - // We substract the size of all previous chunks from the total file size to get the - // size of the final chunk. - file_size - (i * chunk_size) - } else { - chunk_size - }; - - let byte_stream = ByteStream::read_from() - .path(&file_path) - .offset(i * chunk_size) - .length(length) - .build() - .await?; - - byte_streams.push(byte_stream); -} - -for chunk in byte_streams { - // Make requests to a service -} -``` -""" -references = ["aws-sdk-rust#494", "aws-sdk-rust#519"] -meta = { "breaking" = true, "tada" = true, "bug" = false } -author = "Velfi" - -[[smithy-rs]] -message = "Update generated crates to Rust 2021" -references = ["smithy-rs#1332"] -meta = { "breaking" = false, "tada" = false, "bug" = false } -author = "82marbag" +# author = "rcoh" \ No newline at end of file diff --git a/aws/SDK_CHANGELOG.md b/aws/SDK_CHANGELOG.md index cfb0af3561..905b6a40f1 100644 --- a/aws/SDK_CHANGELOG.md +++ b/aws/SDK_CHANGELOG.md @@ -1,4 +1,10 @@ +v0.12.0 (May 13th, 2022) +======================== +**New this release:** +- ([smithy-rs#1352](https://github.com/awslabs/smithy-rs/issues/1352)) Log a debug event when a retry is going to be peformed + + 0.11.0 (April 28th, 2022) ========================= **Breaking Changes:**