Skip to main content

aws_runtime/
content_encoding.rs

1/*
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6mod body;
7mod options;
8mod sign;
9
10pub use body::AwsChunkedBody;
11pub use options::AwsChunkedBodyOptions;
12pub(crate) use sign::SignChunk;
13pub use sign::{DeferredSigner, DeferredSignerSender};
14
15const CRLF: &str = "\r\n";
16const CRLF_RAW: &[u8] = b"\r\n";
17
18const CHUNK_SIGNATURE_BEGIN: &str = ";chunk-signature=";
19const CHUNK_SIGNATURE_BEGIN_RAW: &[u8] = b";chunk-signature=";
20
21const CHUNK_TERMINATOR: &str = "0\r\n";
22const CHUNK_TERMINATOR_RAW: &[u8] = b"0\r\n";
23
24const TRAILER_SEPARATOR: &[u8] = b":";
25
26const DEFAULT_CHUNK_SIZE_BYTE: usize = 64 * 1024; // 64 KB
27
28const SIGNATURE_LENGTH: usize = 64;
29
30/// Content encoding header name constants
31pub mod header {
32    /// Header name denoting "x-amz-trailer-signature"
33    pub const X_AMZ_TRAILER_SIGNATURE: &str = "x-amz-trailer-signature";
34}
35
36/// Content encoding header value constants
37pub mod header_value {
38    /// Header value denoting "aws-chunked" encoding
39    pub const AWS_CHUNKED: &str = "aws-chunked";
40}