MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / fmt

Method fmt

atomic-remote/src/streaming/progress.rs:70–111  ·  view source on GitHub ↗
(&self, f: &mut fmt::Formatter<'_>)

Source from the content-addressed store, hash-verified

68
69impl fmt::Display for TransferProgress {
70 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
71 match self {
72 TransferProgress::Started {
73 total_sections,
74 total_bytes_estimate,
75 } => write!(
76 f,
77 "Starting transfer: {} sections, ~{}",
78 total_sections,
79 format_size(*total_bytes_estimate),
80 ),
81 TransferProgress::SectionComplete {
82 section,
83 bytes_transferred,
84 } => write!(f, " {} {}", section, format_size(*bytes_transferred),),
85 TransferProgress::ChunkComplete {
86 index,
87 bytes_transferred,
88 skipped,
89 } => {
90 if *skipped {
91 write!(f, " chunk #{} (skipped — already present)", index)
92 } else {
93 write!(
94 f,
95 " chunk #{} {}",
96 index,
97 format_size(*bytes_transferred as u64),
98 )
99 }
100 }
101 TransferProgress::Finished {
102 total_bytes,
103 elapsed_ms,
104 } => write!(
105 f,
106 "Transfer complete: {} in {:.1}s",
107 format_size(*total_bytes),
108 *elapsed_ms as f64 / 1000.0,
109 ),
110 }
111 }
112}
113
114// ═══════════════════════════════════════════════════════════════════════

Callers

nothing calls this directly

Calls 1

bytes_per_secondMethod · 0.80

Tested by

no test coverage detected