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§
Source§impl 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
pub fn hunks_mut(&mut self) -> &mut [Hunk]
Trait Implementations§
Source§impl Clone for PatchedFile
impl Clone for PatchedFile
Source§fn clone(&self) -> PatchedFile
fn clone(&self) -> PatchedFile
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PatchedFile
impl Debug for PatchedFile
Source§impl Display for PatchedFile
impl Display for PatchedFile
Source§impl Hash for PatchedFile
impl Hash for PatchedFile
Source§impl Index<usize> for PatchedFile
impl Index<usize> for PatchedFile
Source§impl IndexMut<usize> for PatchedFile
impl IndexMut<usize> for PatchedFile
Source§impl IntoIterator for PatchedFile
impl IntoIterator for PatchedFile
Source§impl PartialEq for PatchedFile
impl PartialEq for PatchedFile
impl Eq for PatchedFile
impl StructuralPartialEq for PatchedFile
Auto Trait Implementations§
impl Freeze for PatchedFile
impl RefUnwindSafe for PatchedFile
impl Send for PatchedFile
impl Sync for PatchedFile
impl Unpin for PatchedFile
impl UnwindSafe for PatchedFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)