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
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use ;
use crateerror;
/// Types for single object upload operation
/// Types for single object download operation
/// Types for multiple object download operation
/// Types for multiple object upload operation
// The default delimiter of the S3 object key
pub const DEFAULT_DELIMITER: &str = "/";
/// Conservative per-transfer backstop on concurrently-materialized child
/// transfers (shared by upload_objects and download_objects).
///
/// The scheduler's hierarchical fair-share drives throughput and the walker
/// provides natural rate-limiting, so this cap primarily bounds working-set
/// memory. 512 covers the highest useful concurrency observed in practice
/// (100 Gbps links sustain ~200-250 concurrent transfers; 600 Gbps multi-NIC
/// configurations stay below 500). Callers that genuinely need more can
/// override via `max_concurrent_downloads` / `max_concurrent_uploads`.
pub const DEFAULT_MAX_CONCURRENT_CHILDREN: usize = 512;
// Checks if the target path at `path`, with the provided `metadata`, represents a directory.
//
// The caller is responsible for providing the correct `Metadata`. If the `Metadata` is obtained
// via `fs::metadata`, it can only determine whether the path is a file or a directory, but it cannot
// indicate whether the path is a symbolic link. On the other hand, if `Metadata` is obtained through
// `fs::symlink_metadata`, it can identify symbolic links, but calling `is_dir()` on a symlink will
// return false, even if the symlink points to a directory.
pub