pub struct PatchSet { /* private fields */ }
Expand description
Unfied patchset
You can iterate over it to get PatchedFile
s.
ⓘ
let mut patch = PatchSet::new();
patch.parse("some diff");
for patched_file in patch {
// do something with patched_file
for hunk in patched_file {
// do something with hunk
for line in hunk {
// do something with line
}
}
}
Implementations
sourceimpl PatchSet
impl PatchSet
sourcepub fn added_files(&self) -> Vec<PatchedFile>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn added_files(&self) -> Vec<PatchedFile>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Added files vector
sourcepub fn removed_files(&self) -> Vec<PatchedFile>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn removed_files(&self) -> Vec<PatchedFile>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Removed files vector
sourcepub fn modified_files(&self) -> Vec<PatchedFile>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn modified_files(&self) -> Vec<PatchedFile>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Modified files vector
sourcepub fn with_encoding(coding: &'static Encoding) -> PatchSet
pub fn with_encoding(coding: &'static Encoding) -> PatchSet
Initialize a new PatchedSet instance with encoding
sourcepub fn from_encoding<T: AsRef<str>>(coding: T) -> PatchSet
pub fn from_encoding<T: AsRef<str>>(coding: T) -> PatchSet
Initialize a new PatchedSet instance with encoding(string form)
sourcepub fn parse_bytes(&mut self, input: &[u8]) -> Result<()>
pub fn parse_bytes(&mut self, input: &[u8]) -> Result<()>
Parse diff from bytes
pub fn is_empty(&self) -> bool
Trait Implementations
sourceimpl Index<usize> for PatchSet
impl Index<usize> for PatchSet
type Output = PatchedFile
type Output = PatchedFile
The returned type after indexing.
sourcefn index(&self, idx: usize) -> &PatchedFile
fn index(&self, idx: usize) -> &PatchedFile
Performs the indexing (
container[index]
) operation. Read moresourceimpl IndexMut<usize> for PatchSet
impl IndexMut<usize> for PatchSet
sourcefn index_mut(&mut self, index: usize) -> &mut PatchedFile
fn index_mut(&mut self, index: usize) -> &mut PatchedFile
Performs the mutable indexing (
container[index]
) operation. Read moresourceimpl IntoIterator for PatchSet
impl IntoIterator for PatchSet
type Item = PatchedFile
type Item = PatchedFile
The type of the elements being iterated over.
type IntoIter = IntoIter<PatchedFile, Global>
type IntoIter = IntoIter<PatchedFile, Global>
Which kind of iterator are we turning this into?
Auto Trait Implementations
impl RefUnwindSafe for PatchSet
impl Send for PatchSet
impl Sync for PatchSet
impl Unpin for PatchSet
impl UnwindSafe for PatchSet
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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