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
// SPDX-License-Identifier: Apache-2.0
/// A trait for observing the progress of upload operations.
///
/// Implementors of this trait can receive real-time notifications about upload progress,
/// allowing for features like progress bars, bandwidth monitoring, or logging.
///
/// # Thread Safety
///
/// This trait requires `Send + Sync` to ensure it can be safely used across async tasks
/// and shared between threads.
///
/// # Examples
///
/// ```
/// use hakanai_lib::observer::DataTransferObserver;
/// use async_trait::async_trait;
///
/// struct ProgressLogger;
///
/// #[async_trait]
/// impl DataTransferObserver for ProgressLogger {
/// async fn on_progress(&self, bytes_transferred: u64, total_bytes: u64) {
/// let percentage = (bytes_transferred as f64 / total_bytes as f64) * 100.0;
/// println!("Progress: {:.1}%", percentage);
/// }
/// }
/// ```