pub struct DiffFormatter;Expand description
Formats diff results into various text representations
Implementations§
Source§impl DiffFormatter
impl DiffFormatter
Sourcepub fn format_unified<P: AsRef<Path>>(
result: &DiffResult,
old_path: P,
new_path: P,
) -> String
pub fn format_unified<P: AsRef<Path>>( result: &DiffResult, old_path: P, new_path: P, ) -> String
Format a diff result as unified diff
Sourcepub fn format_side_by_side<P: AsRef<Path>>(
result: &DiffResult,
old_path: P,
new_path: P,
width: usize,
) -> String
pub fn format_side_by_side<P: AsRef<Path>>( result: &DiffResult, old_path: P, new_path: P, width: usize, ) -> String
Format a diff result as side-by-side comparison
Sourcepub fn format_git_patch<P: AsRef<Path>>(
result: &DiffResult,
old_path: P,
new_path: P,
) -> String
pub fn format_git_patch<P: AsRef<Path>>( result: &DiffResult, old_path: P, new_path: P, ) -> String
Format as Git patch format
Sourcepub fn format_stats(result: &DiffResult) -> String
pub fn format_stats(result: &DiffResult) -> String
Format diff statistics as a summary
Sourcepub fn format<P: AsRef<Path>>(
result: &DiffResult,
format: DiffFormat,
old_path: P,
new_path: P,
width: Option<usize>,
) -> String
pub fn format<P: AsRef<Path>>( result: &DiffResult, format: DiffFormat, old_path: P, new_path: P, width: Option<usize>, ) -> String
Format with the specified format type
Auto Trait Implementations§
impl Freeze for DiffFormatter
impl RefUnwindSafe for DiffFormatter
impl Send for DiffFormatter
impl Sync for DiffFormatter
impl Unpin for DiffFormatter
impl UnwindSafe for DiffFormatter
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more