pub struct RenderColors<'a> {
pub frag: &'a str,
pub func: &'a str,
pub old: &'a str,
pub new: &'a str,
pub context: &'a str,
pub reset: &'a str,
pub whitespace: &'a str,
}Expand description
ANSI color palette for a unified diff, mirroring git’s diff_get_color
slots. Each field is the raw escape sequence (empty string = no color).
The renderer only consults the slots it paints in the hunk body; the
per-file metainfo slot (meta) lives with the caller’s header emitter and
is intentionally absent here.
Fields§
§frag: &'a strcolor.diff.frag — the @@ .. @@ span.
func: &'a strcolor.diff.func — the section heading after the frag.
old: &'a strcolor.diff.old — removed (-) lines.
new: &'a strcolor.diff.new — added (+) lines.
context: &'a strcolor.diff.context — context ( ) lines and the no-newline marker.
reset: &'a strThe reset sequence terminating each colored span.
whitespace: &'a strcolor.diff.whitespace — the highlight for whitespace errors
(--ws-error-highlight).
Trait Implementations§
Source§impl<'a> Clone for RenderColors<'a>
impl<'a> Clone for RenderColors<'a>
Source§fn clone(&self) -> RenderColors<'a>
fn clone(&self) -> RenderColors<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for RenderColors<'a>
Auto Trait Implementations§
impl<'a> Freeze for RenderColors<'a>
impl<'a> RefUnwindSafe for RenderColors<'a>
impl<'a> Send for RenderColors<'a>
impl<'a> Sync for RenderColors<'a>
impl<'a> Unpin for RenderColors<'a>
impl<'a> UnsafeUnpin for RenderColors<'a>
impl<'a> UnwindSafe for RenderColors<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more