pub struct DiffHunk {
pub file_path: PathBuf,
pub old_start: u32,
pub old_lines: u32,
pub new_start: u32,
pub new_lines: u32,
pub content: String,
pub change_type: ChangeType,
}Expand description
A single hunk from a unified diff.
§Examples
use argus_core::{DiffHunk, ChangeType};
use std::path::PathBuf;
let hunk = DiffHunk {
file_path: PathBuf::from("src/lib.rs"),
old_start: 10,
old_lines: 5,
new_start: 10,
new_lines: 8,
content: "+ new line\n- old line".into(),
change_type: ChangeType::Modify,
};
assert_eq!(hunk.old_lines, 5);Fields§
§file_path: PathBufPath to the affected file.
old_start: u32Starting line in the old version.
old_lines: u32Number of lines in the old version.
new_start: u32Starting line in the new version.
new_lines: u32Number of lines in the new version.
content: StringRaw diff content for this hunk.
change_type: ChangeTypeClassification of the change.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DiffHunk
impl<'de> Deserialize<'de> for DiffHunk
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DiffHunk
impl RefUnwindSafe for DiffHunk
impl Send for DiffHunk
impl Sync for DiffHunk
impl Unpin for DiffHunk
impl UnsafeUnpin for DiffHunk
impl UnwindSafe for DiffHunk
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