pub struct Patch<'a, T: ToOwned + ?Sized> { /* private fields */ }
Expand description
Representation of all the differences between two files
Implementations§
Source§impl<'a> Patch<'a, str>
impl<'a> Patch<'a, str>
Sourcepub fn from_str(s: &'a str) -> Result<Patch<'a, str>, ParsePatchError>
pub fn from_str(s: &'a str) -> Result<Patch<'a, str>, ParsePatchError>
Parse a Patch
from a string
use diffy::Patch;
let s = "\
--- a/ideals
+++ b/ideals
@@ -1,4 +1,6 @@
First:
Life before death,
strength before weakness,
journey before destination.
+Second:
+ I will protect those who cannot protect themselves.
";
let patch = Patch::from_str(s).unwrap();
Trait Implementations§
impl<'a, T: Eq + ToOwned + ?Sized> Eq for Patch<'a, T>
impl<'a, T: ToOwned + ?Sized> StructuralPartialEq for Patch<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for Patch<'a, T>
impl<'a, T> RefUnwindSafe for Patch<'a, T>
impl<'a, T> Send for Patch<'a, T>
impl<'a, T> Sync for Patch<'a, T>
impl<'a, T> Unpin for Patch<'a, T>
impl<'a, T> UnwindSafe for Patch<'a, T>
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