Skip to main content

Builder

Struct Builder 

Source
pub struct Builder { /* private fields */ }
Expand description

Builder for constructing customized DiffRowGenerator instances.

Implementations§

Source§

impl Builder

Source

pub fn new() -> Self

Creates a new builder with default settings.

Source

pub fn show_inline_diffs(self, val: bool) -> Self

Source

pub fn ignore_white_spaces(self, val: bool) -> Self

Source

pub fn report_lines_unchanged(self, val: bool) -> Self

Source

pub fn old_tag<F>(self, generator: F) -> Self
where F: Fn(Tag, bool) -> String + Send + Sync + 'static,

Source

pub fn old_tag_simple<F>(self, generator: F) -> Self
where F: Fn(bool) -> String + Send + Sync + 'static,

Source

pub fn new_tag<F>(self, generator: F) -> Self
where F: Fn(Tag, bool) -> String + Send + Sync + 'static,

Source

pub fn new_tag_simple<F>(self, generator: F) -> Self
where F: Fn(bool) -> String + Send + Sync + 'static,

Source

pub fn process_diffs<F>(self, processor: F) -> Self
where F: Fn(&str) -> String + Send + Sync + 'static,

Source

pub fn process_equalities<F>(self, processor: F) -> Self
where F: Fn(&str) -> String + Send + Sync + 'static,

Source

pub fn column_width(self, width: usize) -> Self

Source

pub fn merge_original_revised(self, merge: bool) -> Self

Source

pub fn decompress_deltas(self, decompress: bool) -> Self

Source

pub fn inline_diff_by_word(self, inline_diff_by_word: bool) -> Self

Source

pub fn inline_diff_by_splitter<F>(self, splitter: F) -> Self
where F: Fn(&str) -> Vec<String> + Send + Sync + 'static,

Source

pub fn line_normalizer<F>(self, normalizer: F) -> Self
where F: Fn(&str) -> String + Send + Sync + 'static,

Source

pub fn equalizer<F>(self, equalizer: F) -> Self
where F: Fn(&str, &str) -> bool + Send + Sync + 'static,

Source

pub fn replace_original_linefeed_in_changes_with_spaces( self, replace: bool, ) -> Self

Source

pub fn inline_delta_merger<F>(self, merger: F) -> Self
where F: Fn(&InlineDeltaMergeInfo<String>) -> Vec<Delta<String>> + Send + Sync + 'static,

Source

pub fn inline_delta_merger_arc(self, merger: InlineDeltaMergerFn) -> Self

Source

pub fn build(self) -> DiffRowGenerator

Trait Implementations§

Source§

impl Default for Builder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.