Expand description
Representation of all the differences between two files
Implementations
sourceimpl<'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();
sourceimpl<'a> Patch<'a, [u8]>
impl<'a> Patch<'a, [u8]>
sourcepub fn from_bytes(s: &'a [u8]) -> Result<Patch<'a, [u8]>, ParsePatchError>
pub fn from_bytes(s: &'a [u8]) -> Result<Patch<'a, [u8]>, ParsePatchError>
Parse a Patch
from bytes
Trait Implementations
sourceimpl<T: ?Sized, O> Debug for Patch<'_, T> where
T: ToOwned<Owned = O> + Debug,
O: Borrow<T> + Debug,
impl<T: ?Sized, O> Debug for Patch<'_, T> where
T: ToOwned<Owned = O> + Debug,
O: Borrow<T> + Debug,
sourceimpl<'a, T: PartialEq + ToOwned + ?Sized> PartialEq<Patch<'a, T>> for Patch<'a, T>
impl<'a, T: PartialEq + ToOwned + ?Sized> PartialEq<Patch<'a, T>> 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more