Struct unidiff::PatchSet
[−]
[src]
pub struct PatchSet { /* fields omitted */ }
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 } } }
Methods
impl PatchSet
[src]
pub fn added_files(&self) -> Vec<PatchedFile>
[src]
Added files vector
pub fn removed_files(&self) -> Vec<PatchedFile>
[src]
Removed files vector
pub fn modified_files(&self) -> Vec<PatchedFile>
[src]
Modified files vector
pub fn new() -> PatchSet
[src]
Initialize a new PatchSet instance
pub fn with_encoding(coding: EncodingRef) -> PatchSet
[src]
Initialize a new PatchedSet instance with encoding
pub fn from_encoding<T: AsRef<str>>(coding: T) -> PatchSet
[src]
Initialize a new PatchedSet instance with encoding(string form)
pub fn parse_bytes(&mut self, input: &[u8]) -> Result<()>
[src]
Parse diff from bytes
pub fn parse<T: AsRef<str>>(&mut self, input: T) -> Result<()>
[src]
Parse diff from string
pub fn len(&self) -> usize
[src]
Count of patched files
pub fn is_empty(&self) -> bool
[src]
Trait Implementations
impl Clone for PatchSet
[src]
fn clone(&self) -> PatchSet
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for PatchSet
[src]
impl Debug for PatchSet
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Display for PatchSet
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl IntoIterator for PatchSet
[src]
type Item = PatchedFile
The type of the elements being iterated over.
type IntoIter = IntoIter<PatchedFile>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
Creates an iterator from a value. Read more
impl Index<usize> for PatchSet
[src]
type Output = PatchedFile
The returned type after indexing.
fn index(&self, idx: usize) -> &PatchedFile
[src]
Performs the indexing (container[index]
) operation.
impl IndexMut<usize> for PatchSet
[src]
fn index_mut(&mut self, index: usize) -> &mut PatchedFile
[src]
Performs the mutable indexing (container[index]
) operation.