mermaid_cli/tui/state/
status.rs1use std::time::Instant;
6
7#[derive(Debug)]
9pub struct StatusState {
10 pub status_message: Option<String>,
11 pub status_timestamp: Option<Instant>,
12}
13
14impl StatusState {
15 pub fn new() -> Self {
16 Self {
17 status_message: None,
18 status_timestamp: None,
19 }
20 }
21
22 pub fn set(&mut self, message: impl Into<String>) {
24 self.status_message = Some(message.into());
25 self.status_timestamp = Some(Instant::now());
26 }
27
28 pub fn clear(&mut self) {
30 self.status_message = None;
31 self.status_timestamp = None;
32 }
33}
34
35impl Default for StatusState {
36 fn default() -> Self {
37 Self::new()
38 }
39}