Skip to main content

DiffBuilder

Struct DiffBuilder 

Source
pub struct DiffBuilder<'a> { /* private fields */ }
Expand description

Builder for diff operations Builder for creating diff operations with various options.

Implementations§

Source§

impl<'a> DiffBuilder<'a>

Source

pub fn new( ctx: &'a mut Context, path1: impl Into<String>, revision1: Revision, path2: impl Into<String>, revision2: Revision, ) -> Self

Creates a new DiffBuilder for comparing two paths/revisions.

Source

pub fn depth(self, depth: Depth) -> Self

Sets the depth for the diff operation.

Source

pub fn diff_options(self, options: Vec<String>) -> Self

Sets additional options to pass to the diff command.

Source

pub fn relative_to_dir(self, dir: impl Into<String>) -> Self

Sets the directory to make paths relative to.

Source

pub fn ignore_ancestry(self, ignore: bool) -> Self

Sets whether to ignore ancestry when comparing.

Source

pub fn no_diff_added(self, no_diff: bool) -> Self

Sets whether to omit diffs for added files.

Source

pub fn no_diff_deleted(self, no_diff: bool) -> Self

Sets whether to omit diffs for deleted files.

Source

pub fn show_copies_as_adds(self, show: bool) -> Self

Sets whether to show copies as additions.

Source

pub fn ignore_content_type(self, ignore: bool) -> Self

Sets whether to ignore content type differences.

Source

pub fn ignore_properties(self, ignore: bool) -> Self

Sets whether to ignore property differences.

Source

pub fn properties_only(self, only: bool) -> Self

Sets whether to show only property differences.

Source

pub fn use_git_diff_format(self, use_git: bool) -> Self

Sets whether to use Git diff format.

Source

pub fn header_encoding(self, encoding: impl Into<String>) -> Self

Sets the encoding for diff headers.

Source

pub fn changelists(self, lists: Vec<String>) -> Self

Sets the changelists to include in the diff.

Source

pub fn execute( self, outstream: &mut Stream, errstream: &mut Stream, ) -> Result<(), Error<'static>>

Executes the diff operation.

Auto Trait Implementations§

§

impl<'a> Freeze for DiffBuilder<'a>

§

impl<'a> !RefUnwindSafe for DiffBuilder<'a>

§

impl<'a> Send for DiffBuilder<'a>

§

impl<'a> !Sync for DiffBuilder<'a>

§

impl<'a> Unpin for DiffBuilder<'a>

§

impl<'a> UnsafeUnpin for DiffBuilder<'a>

§

impl<'a> !UnwindSafe for DiffBuilder<'a>

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