forked from smithy-lang/smithy-rs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCHANGELOG.next.toml
71 lines (61 loc) · 2.39 KB
/
CHANGELOG.next.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Example changelog entries
# [[aws-sdk-rust]]
# message = "Fix typos in module documentation for generated crates"
# references = ["smithy-rs#920"]
# meta = { "breaking" = false, "tada" = false, "bug" = false }
# author = "rcoh"
#
# [[smithy-rs]]
# 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"