Skip to main content

UnifiedDiffFile

Struct UnifiedDiffFile 

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

Holds metadata and the patch for a single file in a unified diff.

Implementations§

Source§

impl UnifiedDiffFile

Source

pub fn new() -> Self

Constructs a new, empty UnifiedDiffFile.

Source

pub fn from( from_file: impl Into<String>, to_file: impl Into<String>, patch: Patch<String>, ) -> Self

Constructs a UnifiedDiffFile with initial from_file, to_file, and patch.

Source

pub fn diff_command(&self) -> Option<&str>

Source

pub fn set_diff_command(&mut self, diff_command: impl Into<String>)

Source

pub fn from_file(&self) -> Option<&str>

Source

pub fn set_from_file(&mut self, from_file: impl Into<String>)

Source

pub fn to_file(&self) -> Option<&str>

Source

pub fn set_to_file(&mut self, to_file: impl Into<String>)

Source

pub fn index(&self) -> Option<&str>

Source

pub fn set_index(&mut self, index: impl Into<String>)

Source

pub fn patch(&self) -> &Patch<String>

Source

pub fn patch_mut(&mut self) -> &mut Patch<String>

Source

pub fn set_patch(&mut self, patch: Patch<String>)

Source

pub fn from_timestamp(&self) -> Option<&str>

Source

pub fn set_from_timestamp(&mut self, from_timestamp: impl Into<String>)

Source

pub fn to_timestamp(&self) -> Option<&str>

Source

pub fn set_to_timestamp(&mut self, to_timestamp: impl Into<String>)

Source

pub fn similarity_index(&self) -> Option<i32>

Source

pub fn set_similarity_index(&mut self, similarity_index: Option<i32>)

Source

pub fn rename_from(&self) -> Option<&str>

Source

pub fn set_rename_from(&mut self, rename_from: impl Into<String>)

Source

pub fn rename_to(&self) -> Option<&str>

Source

pub fn set_rename_to(&mut self, rename_to: impl Into<String>)

Source

pub fn copy_from(&self) -> Option<&str>

Source

pub fn set_copy_from(&mut self, copy_from: impl Into<String>)

Source

pub fn copy_to(&self) -> Option<&str>

Source

pub fn set_copy_to(&mut self, copy_to: impl Into<String>)

Source

pub fn new_file_mode(&self) -> Option<&str>

Source

pub fn set_new_file_mode(&mut self, new_file_mode: impl Into<String>)

Source

pub fn deleted_file_mode(&self) -> Option<&str>

Source

pub fn set_deleted_file_mode(&mut self, deleted_file_mode: impl Into<String>)

Source

pub fn old_mode(&self) -> Option<&str>

Source

pub fn set_old_mode(&mut self, old_mode: impl Into<String>)

Source

pub fn new_mode(&self) -> Option<&str>

Source

pub fn set_new_mode(&mut self, new_mode: impl Into<String>)

Source

pub fn binary_added(&self) -> Option<&str>

Source

pub fn set_binary_added(&mut self, binary_added: impl Into<String>)

Source

pub fn binary_deleted(&self) -> Option<&str>

Source

pub fn set_binary_deleted(&mut self, binary_deleted: impl Into<String>)

Source

pub fn binary_edited(&self) -> Option<&str>

Source

pub fn set_binary_edited(&mut self, binary_edited: impl Into<String>)

Source

pub fn is_no_new_line_at_the_end_of_the_file(&self) -> bool

Source

pub fn set_no_new_line_at_the_end_of_the_file(&mut self, val: bool)

Trait Implementations§

Source§

impl Clone for UnifiedDiffFile

Source§

fn clone(&self) -> UnifiedDiffFile

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for UnifiedDiffFile

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for UnifiedDiffFile

Source§

fn default() -> UnifiedDiffFile

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

impl Eq for UnifiedDiffFile

Source§

impl PartialEq for UnifiedDiffFile

Source§

fn eq(&self, other: &UnifiedDiffFile) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for UnifiedDiffFile

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.