Struct unidiff::PatchedFile
source · pub struct PatchedFile {
pub source_file: String,
pub source_timestamp: Option<String>,
pub target_file: String,
pub target_timestamp: Option<String>,
/* private fields */
}
Expand description
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
Implementations
sourceimpl PatchedFile
impl PatchedFile
sourcepub fn new<T: Into<String>>(source_file: T, target_file: T) -> PatchedFile
pub fn new<T: Into<String>>(source_file: T, target_file: T) -> PatchedFile
Initialize a new PatchedFile instance
sourcepub fn with_hunks<T: Into<String>>(
source_file: T,
target_file: T,
hunks: Vec<Hunk>
) -> PatchedFile
pub fn with_hunks<T: Into<String>>(
source_file: T,
target_file: T,
hunks: Vec<Hunk>
) -> PatchedFile
Initialize a new PatchedFile instance with hunks
sourcepub fn is_added_file(&self) -> bool
pub fn is_added_file(&self) -> bool
Is this file newly added
sourcepub fn is_removed_file(&self) -> bool
pub fn is_removed_file(&self) -> bool
Is this file removed
sourcepub fn is_modified_file(&self) -> bool
pub fn is_modified_file(&self) -> bool
Is this file modified
pub fn is_empty(&self) -> bool
Trait Implementations
sourceimpl Clone for PatchedFile
impl Clone for PatchedFile
sourcefn clone(&self) -> PatchedFile
fn clone(&self) -> PatchedFile
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for PatchedFile
impl Debug for PatchedFile
sourceimpl Display for PatchedFile
impl Display for PatchedFile
sourceimpl Hash for PatchedFile
impl Hash for PatchedFile
sourceimpl Index<usize> for PatchedFile
impl Index<usize> for PatchedFile
sourceimpl IndexMut<usize> for PatchedFile
impl IndexMut<usize> for PatchedFile
sourceimpl IntoIterator for PatchedFile
impl IntoIterator for PatchedFile
sourceimpl PartialEq<PatchedFile> for PatchedFile
impl PartialEq<PatchedFile> for PatchedFile
sourcefn eq(&self, other: &PatchedFile) -> bool
fn eq(&self, other: &PatchedFile) -> bool
impl Eq for PatchedFile
impl StructuralEq for PatchedFile
impl StructuralPartialEq for PatchedFile
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more