ratatui_toolkit/widgets/markdown_widget/state/git_stats_state/mod.rs
1//! Git stats state for markdown widget.
2//!
3//! Tracks git diff statistics for the markdown source file.
4
5pub mod constructors;
6pub mod helpers;
7pub mod methods;
8pub mod traits;
9
10pub use constructors::*;
11pub use methods::*;
12pub use traits::*;
13
14use crate::widgets::markdown_widget::foundation::types::GitStats;
15use std::time::Instant;
16
17/// Git stats state for markdown source files.
18///
19/// Tracks additions, modifications, and deletions from git diff.
20#[derive(Debug, Clone)]
21pub struct GitStatsState {
22 /// Whether to show git stats in the statusline.
23 show: bool,
24 /// Cached git stats for the source file.
25 cache: Option<GitStats>,
26 /// Last time git stats were updated.
27 last_update: Option<Instant>,
28}