Skip to main content

DiffColors

Struct DiffColors 

Source
pub struct DiffColors {
Show 16 fields pub meta: String, pub frag: String, pub func: String, pub old: String, pub new: String, pub context: String, pub reset: String, pub whitespace: String, pub old_moved: String, pub old_moved_alt: String, pub old_moved_dim: String, pub old_moved_alt_dim: String, pub new_moved: String, pub new_moved_alt: String, pub new_moved_dim: String, pub new_moved_alt_dim: String,
}
Expand description

ANSI palette for colored diff output. Each slot holds the escape sequence (empty when color is disabled), mirroring diff_get_color.

Fields§

§meta: String§frag: String§func: String§old: String§new: String§context: String§reset: String§whitespace: String

color.diff.whitespace — the highlight for whitespace errors (--ws-error-highlight). Default [7m (reverse), matching git.

§old_moved: String§old_moved_alt: String§old_moved_dim: String§old_moved_alt_dim: String§new_moved: String§new_moved_alt: String§new_moved_dim: String§new_moved_alt_dim: String

Implementations§

Source§

impl DiffColors

Source

pub fn enabled(config: Option<&GitConfig>) -> Self

The default enabled palette: meta=bold, frag=cyan, old=red, new=green, func/context unset, overridden by color.diff.<slot> with the legacy diff.color.<slot> spelling as a fallback.

Trait Implementations§

Source§

impl Clone for DiffColors

Source§

fn clone(&self) -> DiffColors

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Default for DiffColors

Source§

fn default() -> DiffColors

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> 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.