pub struct FilePatch {
pub old_path: Option<Vec<u8>>,
pub new_path: Option<Vec<u8>>,
pub old_mode: Option<u32>,
pub new_mode: Option<u32>,
pub hunks: Vec<Hunk>,
pub is_new: bool,
pub is_delete: bool,
pub is_rename: bool,
pub is_copy: bool,
pub similarity: Option<u8>,
pub dissimilarity: Option<u8>,
}Expand description
A patch targeting a single file. Produced by parse_unified_patch.
Fields§
§old_path: Option<Vec<u8>>Path on the a/ (old) side, or None for a newly created file.
new_path: Option<Vec<u8>>Path on the b/ (new) side, or None for a deleted file.
old_mode: Option<u32>Mode of the old file, when a mode header was present.
new_mode: Option<u32>Mode of the new file, when a mode header was present.
hunks: Vec<Hunk>§is_new: boolThe patch creates a new file (--- /dev/null / new file mode).
is_delete: boolThe patch deletes the file (+++ /dev/null / deleted file mode).
is_rename: boolThe patch renames the file (rename from/rename to).
is_copy: boolThe patch copies the file (copy from/copy to).
similarity: Option<u8>Similarity score from similarity index N%, used for rename/copy summaries.
dissimilarity: Option<u8>Dissimilarity score from dissimilarity index N%, used for rewrite summaries.
Trait Implementations§
impl Eq for FilePatch
impl StructuralPartialEq for FilePatch
Auto Trait Implementations§
impl Freeze for FilePatch
impl RefUnwindSafe for FilePatch
impl Send for FilePatch
impl Sync for FilePatch
impl Unpin for FilePatch
impl UnsafeUnpin for FilePatch
impl UnwindSafe for FilePatch
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