Skip to main content

storage_transfer_lib/
common.rs

1use opendal::Metadata;
2
3// Describes one file object queued for copying; contains no object data.
4// The producer filters out directory entries before creating tasks.
5#[derive(Clone, Debug)]
6pub struct ObjectTask {
7    // Object key relative to the source operator's directory root.
8    pub path: String,
9    // Metadata returned by listing, including the file size.
10    pub metadata: Metadata,
11}
12
13#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, serde::Serialize)]
14pub struct TransferProgress {
15    pub listed_objects: u64,
16    /// Logical bytes delivered to copy workers, including copies that later fail.
17    pub read_bytes: u64,
18    // Counted after the destination writer closes successfully.
19    pub copied_objects: u64,
20    pub copied_bytes: u64,
21}