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
/*! Library provided plugins
# Building your own plugins
First you will need to create a struct to hold the information you wish displayed in the status blocks. When implementing the plugin's new() function it is importatn that it return itself in a [`Box`]. Once you have created your status plugin you will need to implement both the [Display](std::fmt::Display) and [Update](crate::Update) traits; the implementation of which can be found below.
## Example Plugin
For the following example we are going to be creating a simple widget that couts how many seconds the status blocks have been running.
```no_run
use redblocks::Update;
use std::fmt::{self, Display};
struct Counter(u64);
impl Counter {
fn new() -> Box<Self> {
Box::new(Self(0))
}
}
impl Display for Counter {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.0)
}
}
impl Update for Counter {
fn refresh(&mut self) {
self.0 = self.0 + 1;
}
}
```
*/
pub use strftime;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;