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§
source§impl<T, O> Debug for Patch<'_, T>where
T: ToOwned<Owned = O> + Debug + ?Sized,
O: Borrow<T> + Debug,
impl<T, O> Debug for Patch<'_, T>where T: ToOwned<Owned = O> + Debug + ?Sized, O: Borrow<T> + Debug,
source§impl<'a, T: PartialEq + ToOwned + ?Sized> PartialEq for Patch<'a, T>
impl<'a, T: PartialEq + ToOwned + ?Sized> PartialEq for Patch<'a, T>
impl<'a, T: Eq + ToOwned + ?Sized> Eq for Patch<'a, T>
impl<'a, T: ToOwned + ?Sized> StructuralEq for Patch<'a, T>
impl<'a, T: ToOwned + ?Sized> StructuralPartialEq for Patch<'a, T>
Auto Trait Implementations§
impl<'a, T: ?Sized> RefUnwindSafe for Patch<'a, T>where T: RefUnwindSafe, <T as ToOwned>::Owned: RefUnwindSafe,
impl<'a, T: ?Sized> Send for Patch<'a, T>where T: Sync, <T as ToOwned>::Owned: Send,
impl<'a, T: ?Sized> Sync for Patch<'a, T>where T: Sync, <T as ToOwned>::Owned: Sync,
impl<'a, T: ?Sized> Unpin for Patch<'a, T>where <T as ToOwned>::Owned: Unpin,
impl<'a, T: ?Sized> UnwindSafe for Patch<'a, T>where T: RefUnwindSafe, <T as ToOwned>::Owned: UnwindSafe,
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