Skip to main content

DiffstatOptions

Struct DiffstatOptions 

Source
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: usize

Total display width for the stat block (after subtracting line_prefix when using terminal width).

§line_prefix: &'a str

Prefix printed before each stat line (graph + color); only affects width budget when subtract_prefix_from_terminal is true.

§subtract_prefix_from_terminal: bool

When 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 str

ANSI SGR before + run (empty = no color).

§color_del: &'a str

ANSI SGR before - run (empty = no color).

§color_reset: &'a str

ANSI reset after colored bar segments (typically \x1b[m).

§graph_bar_slack: usize

Extra columns allocated to the +/- bar (Git log --graph --stat uses one more than plain diffstat).

§graph_prefix_budget_slack: usize

When subtracting line_prefix from COLUMNS, add this many columns back (colored graph |).

Trait Implementations§

Source§

impl<'a> Clone for DiffstatOptions<'a>

Source§

fn clone(&self) -> DiffstatOptions<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for DiffstatOptions<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for DiffstatOptions<'a>

§

impl<'a> RefUnwindSafe for DiffstatOptions<'a>

§

impl<'a> Send for DiffstatOptions<'a>

§

impl<'a> Sync for DiffstatOptions<'a>

§

impl<'a> Unpin for DiffstatOptions<'a>

§

impl<'a> UnsafeUnpin for DiffstatOptions<'a>

§

impl<'a> UnwindSafe for DiffstatOptions<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.