[−][src]Struct unidiff::PatchedFile
Patch updated file, contains a list of Hunks
You can iterate over it to get Hunk
s.
Fields
source_file: String
Source file name
source_timestamp: Option<String>
Source file timestamp
target_file: String
Target file name
target_timestamp: Option<String>
Target file timestamp
Methods
impl PatchedFile
[src]
pub fn new<T: Into<String>>(source_file: T, target_file: T) -> PatchedFile
[src]
Initialize a new PatchedFile instance
pub fn with_hunks<T: Into<String>>(
source_file: T,
target_file: T,
hunks: Vec<Hunk>
) -> PatchedFile
[src]
source_file: T,
target_file: T,
hunks: Vec<Hunk>
) -> PatchedFile
Initialize a new PatchedFile instance with hunks
pub fn path(&self) -> String
[src]
Patched file relative path
pub fn added(&self) -> usize
[src]
Count of lines added
pub fn removed(&self) -> usize
[src]
Count of lines removed
pub fn is_added_file(&self) -> bool
[src]
Is this file newly added
pub fn is_removed_file(&self) -> bool
[src]
Is this file removed
pub fn is_modified_file(&self) -> bool
[src]
Is this file modified
pub fn len(&self) -> usize
[src]
Count of hunks
pub fn is_empty(&self) -> bool
[src]
pub fn hunks(&self) -> &[Hunk]
[src]
Hunks in this file
pub fn hunks_mut(&mut self) -> &mut [Hunk]
[src]
Trait Implementations
impl Clone for PatchedFile
[src]
fn clone(&self) -> PatchedFile
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PatchedFile
[src]
impl Display for PatchedFile
[src]
impl Eq for PatchedFile
[src]
impl Hash for PatchedFile
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Index<usize> for PatchedFile
[src]
impl IndexMut<usize> for PatchedFile
[src]
impl IntoIterator for PatchedFile
[src]
type Item = Hunk
The type of the elements being iterated over.
type IntoIter = IntoIter<Hunk>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl PartialEq<PatchedFile> for PatchedFile
[src]
fn eq(&self, other: &PatchedFile) -> bool
[src]
fn ne(&self, other: &PatchedFile) -> bool
[src]
impl StructuralEq for PatchedFile
[src]
impl StructuralPartialEq for PatchedFile
[src]
Auto Trait Implementations
impl RefUnwindSafe for PatchedFile
impl Send for PatchedFile
impl Sync for PatchedFile
impl Unpin for PatchedFile
impl UnwindSafe for PatchedFile
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,
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<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,