Skip to main content

storage_transfer_lib/
common.rs

1use opendal::Metadata;
2
3// SHA-256 digest of an object's contents, used to verify the copied data.
4pub(crate) type Sha256Digest = [u8; 32];
5
6// Describes one file object queued for copying; contains no object data.
7// The producer filters out directory entries before creating tasks.
8#[derive(Clone, Debug)]
9pub struct ObjectTask {
10    // Object key relative to the source bucket root.
11    pub path: String,
12    // Metadata returned by listing, such as size and ETag.
13    pub metadata: Metadata,
14}
15
16#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, serde::Serialize)]
17pub struct TransferProgress {
18    pub listed_objects: u64,
19    // Counted after the destination data and metadata have been verified.
20    pub copied_objects: u64,
21    pub copied_bytes: u64,
22}