[−][src]Struct diffy::Patch
Representation of all the differences between two files
Implementations
impl<'a, T: ToOwned + ?Sized> Patch<'a, T>
[src]
pub fn original(&self) -> Option<&T>
[src]
Return the name of the old file
pub fn modified(&self) -> Option<&T>
[src]
Return the name of the new file
pub fn hunks(&self) -> &[Hunk<T>]
[src]
Returns the hunks in the patch
impl<'_, T: AsRef<[u8]> + ToOwned + ?Sized> Patch<'_, T>
[src]
pub fn to_bytes(&self) -> Vec<u8>
[src]
Convert a Patch
into bytes
This is the equivalent of the to_string
function but for
potentially non-utf8 patches.
impl<'a> Patch<'a, str>
[src]
pub fn from_str(s: &'a str) -> Result<Patch<'a, str>, ParsePatchError>
[src]
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();
impl<'a> Patch<'a, [u8]>
[src]
pub fn from_bytes(s: &'a [u8]) -> Result<Patch<'a, [u8]>, ParsePatchError>
[src]
Parse a Patch
from bytes
Trait Implementations
impl<'_, T: ToOwned + ?Sized> Clone for Patch<'_, T>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'_, T: ?Sized, O> Debug for Patch<'_, T> where
T: ToOwned<Owned = O> + Debug,
O: Borrow<T> + Debug,
[src]
T: ToOwned<Owned = O> + Debug,
O: Borrow<T> + Debug,
impl<'_> Display for Patch<'_, str>
[src]
impl<'a, T: Eq + ToOwned + ?Sized> Eq for Patch<'a, T>
[src]
impl<'a, T: PartialEq + ToOwned + ?Sized> PartialEq<Patch<'a, T>> for Patch<'a, T>
[src]
impl<'a, T: ToOwned + ?Sized> StructuralEq for Patch<'a, T>
[src]
impl<'a, T: ToOwned + ?Sized> StructuralPartialEq for Patch<'a, T>
[src]
Auto Trait Implementations
impl<'a, T: ?Sized> RefUnwindSafe for Patch<'a, T> where
T: RefUnwindSafe,
<T as ToOwned>::Owned: RefUnwindSafe,
T: RefUnwindSafe,
<T as ToOwned>::Owned: RefUnwindSafe,
impl<'a, T: ?Sized> Send for Patch<'a, T> where
T: Sync,
<T as ToOwned>::Owned: Send,
T: Sync,
<T as ToOwned>::Owned: Send,
impl<'a, T: ?Sized> Sync for Patch<'a, T> where
T: Sync,
<T as ToOwned>::Owned: Sync,
T: Sync,
<T as ToOwned>::Owned: Sync,
impl<'a, T: ?Sized> Unpin for Patch<'a, T> where
<T as ToOwned>::Owned: Unpin,
<T as ToOwned>::Owned: Unpin,
impl<'a, T: ?Sized> UnwindSafe for Patch<'a, T> where
T: RefUnwindSafe,
<T as ToOwned>::Owned: UnwindSafe,
T: RefUnwindSafe,
<T as ToOwned>::Owned: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,