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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! UI-agnostic progress reporting.
//!
//! The engine performs long-running network and IO work (manifest downloads,
//! concurrent package downloads) but must not depend on any particular UI
//! toolkit. Callers provide a [`ProgressReporter`]; a CLI can wire it to
//! `indicatif`, a GUI can wire it to reactive signals, and tests can use the
//! default [`NoopProgress`].
/// Factory for per-unit-of-work progress handles.
///
/// Implementations are shared across concurrent tasks, so this trait requires
/// `Send + Sync`.
/// A handle to a single in-flight unit of work.
///
/// The engine calls [`finish`](ProgressHandle::finish) exactly once when the work
/// ends — whether it succeeded or failed — so an implementation can rely on
/// `finish` to clear or finalize its display and should not leave a bar dangling
/// if it is never called again.
///
/// Handles are `Send + Sync`: a single handle is shared by reference across the
/// retried attempts of one download, and that download future must stay `Send` so
/// callers can drive it from a multi-threaded runtime (e.g. `tokio::spawn`).
/// A [`ProgressReporter`] that discards all progress updates.
///
/// This is the default used by [`crate::client::ThunderstoreClientBuilder`] when
/// no reporter is supplied.
;
/// A no-op [`ProgressHandle`] returned by [`NoopProgress`].
;