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
/// Update a [progress bar](fn@crate::progress)
///
/// The macro takes 2 parts separated by comma `,`:
/// - An expression for updating the progress:
/// - Optional format args for updating the message.
///
/// The progress update expression can be one of:
/// - `bar = i`: set the progress to `i`
/// - `bar += i`: increment the steps by i
/// - `bar`: don't update the progress
///
/// , where `bar` is an ident
///
/// The format args can be omitted to update the progress without
/// updating the message
///
/// # Examples
/// ```rust,no_run
/// # use pistonite_cu as cu;
/// let bar = cu::progress("10 steps").total(10).spawn();
/// // update the current count and message
/// let i = 1;
/// cu::progress!(bar = i, "doing step {i}");
/// // update the current count without changing message
/// cu::progress!(bar += 2);
/// // update the message without changing current step
/// cu::progress!(bar, "doing the thing");
/// ```