| 1 | use super::Block; |
| 2 | use anyhow::Result; |
| 3 | use std::time::Duration; |
| 4 | |
| 5 | pub struct Sep { |
| 6 | text: &'static str, |
| 7 | color: u32, |
| 8 | } |
| 9 | |
| 10 | impl Sep { |
| 11 | pub fn new(text: &'static str, color: u32) -> Self { |
| 12 | Self { text, color } |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | impl Block for Sep { |
| 17 | fn content(&mut self) -> Result<String> { |
| 18 | Ok(self.text.to_string()) |
| 19 | } |
| 20 | |
| 21 | fn interval(&self) -> Duration { |
| 22 | Duration::from_secs(u64::MAX) |
| 23 | } |
| 24 | |
| 25 | fn color(&self) -> u32 { |
| 26 | self.color |
| 27 | } |
| 28 | } |