Struct similar::text::UnifiedDiff [−][src]
Unified diff formatter.
The Display
implementation renders a unified diff.
Implementations
impl<'diff, 'old, 'new, 'bufs> UnifiedDiff<'diff, 'old, 'new, 'bufs>
[src]
pub fn from_text_diff(diff: &'diff TextDiff<'old, 'new, 'bufs>) -> Self
[src]
Creates a formatter from a text diff object.
pub fn context_radius(&mut self, n: usize) -> &mut Self
[src]
Changes the context radius.
The context radius is the number of lines between changes that should
be emitted. This defaults to 3
.
pub fn header(&mut self, a: &str, b: &str) -> &mut Self
[src]
Sets a header to the diff.
a
and b
are the file names that are added to the top of the unified
file format. The names are accepted verbaitim which lets you encode
a timestamp into it when separated by a tab (\t
). For more information
see the unified diff format specification
pub fn iter_hunks(
&self
) -> impl Iterator<Item = UnifiedDiffHunk<'diff, 'old, 'new, 'bufs>>
[src]
&self
) -> impl Iterator<Item = UnifiedDiffHunk<'diff, 'old, 'new, 'bufs>>
Iterates over all hunks as configured.
Trait Implementations
impl<'diff, 'old, 'new, 'bufs> Display for UnifiedDiff<'diff, 'old, 'new, 'bufs>
[src]
Auto Trait Implementations
impl<'diff, 'old, 'new, 'bufs> RefUnwindSafe for UnifiedDiff<'diff, 'old, 'new, 'bufs>
[src]
impl<'diff, 'old, 'new, 'bufs> Send for UnifiedDiff<'diff, 'old, 'new, 'bufs>
[src]
impl<'diff, 'old, 'new, 'bufs> Sync for UnifiedDiff<'diff, 'old, 'new, 'bufs>
[src]
impl<'diff, 'old, 'new, 'bufs> Unpin for UnifiedDiff<'diff, 'old, 'new, 'bufs> where
'bufs: 'diff,
'new: 'diff,
'old: 'diff,
[src]
'bufs: 'diff,
'new: 'diff,
'old: 'diff,
impl<'diff, 'old, 'new, 'bufs> UnwindSafe for UnifiedDiff<'diff, 'old, 'new, 'bufs>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,