Struct git2::Patch [−][src]
pub struct Patch<'buffers> { /* fields omitted */ }
Expand description
A structure representing the text changes in a single diff delta.
This is an opaque structure.
Implementations
Return a Patch for one file in a Diff.
Returns Ok(None) for an unchanged or binary file.
Generate a Patch by diffing two blobs.
pub fn from_blob_and_buffer(
old_blob: &Blob<'buffers>,
old_path: Option<&Path>,
new_buffer: &'buffers [u8],
new_path: Option<&Path>,
opts: Option<&mut DiffOptions>
) -> Result<Self, Error>
pub fn from_blob_and_buffer(
old_blob: &Blob<'buffers>,
old_path: Option<&Path>,
new_buffer: &'buffers [u8],
new_path: Option<&Path>,
opts: Option<&mut DiffOptions>
) -> Result<Self, Error>
Generate a Patch by diffing a blob and a buffer.
pub fn from_buffers(
old_buffer: &'buffers [u8],
old_path: Option<&Path>,
new_buffer: &'buffers [u8],
new_path: Option<&Path>,
opts: Option<&mut DiffOptions>
) -> Result<Self, Error>
pub fn from_buffers(
old_buffer: &'buffers [u8],
old_path: Option<&Path>,
new_buffer: &'buffers [u8],
new_path: Option<&Path>,
opts: Option<&mut DiffOptions>
) -> Result<Self, Error>
Generate a Patch by diffing two buffers.
Get the number of lines of context, additions, and deletions in the Patch.
Get a DiffHunk and its total line count from the Patch.
Get the number of lines in a hunk.
Get a DiffLine from a hunk of the Patch.
Get the size of a Patch’s diff data in bytes.
Print the Patch to text via a callback.