pub struct DiffRenderer<'a> { /* private fields */ }
Expand description
Configuration and environment to render textual diff.
Implementations§
Source§impl<'a> DiffRenderer<'a>
impl<'a> DiffRenderer<'a>
pub fn new( repo: &'a dyn Repo, path_converter: &'a RepoPathUiConverter, conflict_marker_style: ConflictMarkerStyle, formats: Vec<DiffFormat>, ) -> Self
Sourcepub fn show_diff(
&self,
ui: &Ui,
formatter: &mut dyn Formatter,
from_tree: &MergedTree,
to_tree: &MergedTree,
matcher: &dyn Matcher,
copy_records: &CopyRecords,
width: usize,
) -> Result<(), DiffRenderError>
pub fn show_diff( &self, ui: &Ui, formatter: &mut dyn Formatter, from_tree: &MergedTree, to_tree: &MergedTree, matcher: &dyn Matcher, copy_records: &CopyRecords, width: usize, ) -> Result<(), DiffRenderError>
Generates diff between from_tree
and to_tree
.
Sourcepub fn show_inter_diff(
&self,
ui: &Ui,
formatter: &mut dyn Formatter,
from_commits: &[Commit],
to_commit: &Commit,
matcher: &dyn Matcher,
width: usize,
) -> Result<(), DiffRenderError>
pub fn show_inter_diff( &self, ui: &Ui, formatter: &mut dyn Formatter, from_commits: &[Commit], to_commit: &Commit, matcher: &dyn Matcher, width: usize, ) -> Result<(), DiffRenderError>
Generates diff between from_commits
and to_commit
based off their
parents. The from_commits
will temporarily be rebased onto the
to_commit
parents to exclude unrelated changes.
Sourcepub fn show_patch(
&self,
ui: &Ui,
formatter: &mut dyn Formatter,
commit: &Commit,
matcher: &dyn Matcher,
width: usize,
) -> Result<(), DiffRenderError>
pub fn show_patch( &self, ui: &Ui, formatter: &mut dyn Formatter, commit: &Commit, matcher: &dyn Matcher, width: usize, ) -> Result<(), DiffRenderError>
Generates diff of the given commit
compared to its parents.
Auto Trait Implementations§
impl<'a> Freeze for DiffRenderer<'a>
impl<'a> !RefUnwindSafe for DiffRenderer<'a>
impl<'a> !Send for DiffRenderer<'a>
impl<'a> !Sync for DiffRenderer<'a>
impl<'a> Unpin for DiffRenderer<'a>
impl<'a> !UnwindSafe for DiffRenderer<'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
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