pub struct DiffstatOptions<'a> {
pub total_width: usize,
pub line_prefix: &'a str,
pub subtract_prefix_from_terminal: bool,
pub stat_name_width: Option<usize>,
pub stat_graph_width: Option<usize>,
pub stat_count: Option<usize>,
pub color_add: &'a str,
pub color_del: &'a str,
pub color_reset: &'a str,
pub graph_bar_slack: usize,
pub graph_prefix_budget_slack: usize,
}Expand description
Options for laying out diffstat lines (Git diff_options stat fields).
Fields§
§total_width: usizeTotal display width for the stat block (after subtracting line_prefix when using terminal width).
line_prefix: &'a strPrefix printed before each stat line (graph + color); only affects width budget when
subtract_prefix_from_terminal is true.
subtract_prefix_from_terminal: boolWhen true, width budget is terminal_columns() - display_width_minus_ansi(line_prefix).
stat_name_width: Option<usize>Cap filename area (diff.statNameWidth / --stat-name-width).
stat_graph_width: Option<usize>Cap graph (+/-) area (diff.statGraphWidth / --stat-graph-width).
stat_count: Option<usize>Max files to show; extra files omitted with a ... line.
color_add: &'a strANSI SGR before + run (empty = no color).
color_del: &'a strANSI SGR before - run (empty = no color).
color_reset: &'a strANSI reset after colored bar segments (typically \x1b[m).
graph_bar_slack: usizeExtra columns allocated to the +/- bar (Git log --graph --stat uses one more than plain diffstat).
graph_prefix_budget_slack: usizeWhen subtracting line_prefix from COLUMNS, add this many columns back (colored graph |).
Trait Implementations§
Source§impl<'a> Clone for DiffstatOptions<'a>
impl<'a> Clone for DiffstatOptions<'a>
Source§fn clone(&self) -> DiffstatOptions<'a>
fn clone(&self) -> DiffstatOptions<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more