pub enum Line {
Add {
new: u32,
text: String,
},
Del {
old: u32,
text: String,
},
Ctx {
old: u32,
new: u32,
text: String,
},
Meta {
text: String,
},
}Expand description
One diff line. Encoded as a single-key union —
{ "Add": { "new": 2, "text": "…" } } — with no discriminator field.
Line numbers are 1-based and refer to the side named by the field
(old = pre-image, new = post-image) — the same coordinates comments
anchor to.
Variants§
Add
A line present only in the post-image (+ in unified diff).
Del
A line present only in the pre-image (- in unified diff).
Ctx
An unchanged context line, present on both sides.
Fields
Meta
A diff-level annotation such as \ No newline at end of file; carries
no line numbers.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Line
impl<'de> Deserialize<'de> for Line
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
impl Eq for Line
impl StructuralPartialEq for Line
Auto Trait Implementations§
impl Freeze for Line
impl RefUnwindSafe for Line
impl Send for Line
impl Sync for Line
impl Unpin for Line
impl UnsafeUnpin for Line
impl UnwindSafe for Line
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