pub trait CompareBlobs {
    type Output;

    // Required method
    fn compare_blobs<'a, E>(
        &mut self,
        entry: &'a Entry,
        worktree_blob_size: usize,
        worktree_blob: impl ReadDataOnce<'a, E>,
        entry_blob: impl ReadDataOnce<'a, E>
    ) -> Result<Option<Self::Output>, E>;
}
Expand description

Compares the content of two blobs in some way.

Required Associated Types§

source

type Output

Output data produced by compare_blobs().

Required Methods§

source

fn compare_blobs<'a, E>( &mut self, entry: &'a Entry, worktree_blob_size: usize, worktree_blob: impl ReadDataOnce<'a, E>, entry_blob: impl ReadDataOnce<'a, E> ) -> Result<Option<Self::Output>, E>

Providing the underlying index entry, allow comparing a file in the worktree of size worktree_blob_size and allow reading its bytes using worktree_blob. If this function returns None the entry and the worktree_blob are assumed to be identical. Use entry_blob to obtain the data for the blob referred to by entry, allowing comparisons of the data itself.

Implementors§