Trait gix_status::index_as_worktree::traits::CompareBlobs

source ·
pub trait CompareBlobs {
    type Output;

    // Required method
    fn compare_blobs<'a, 'b>(
        &mut self,
        entry: &Entry,
        worktree_blob_size: u64,
        data: impl ReadData<'a>,
        buf: &mut Vec<u8>
    ) -> Result<Option<Self::Output>, Error>;
}
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, 'b>( &mut self, entry: &Entry, worktree_blob_size: u64, data: impl ReadData<'a>, buf: &mut Vec<u8> ) -> Result<Option<Self::Output>, Error>

Providing the underlying index entry, allow comparing a file in the worktree of size worktree_blob_size and allow streaming its bytes using data. If this function returns None the entry and the worktree blob are assumed to be identical. Use data to obtain the data for the blob referred to by entry, allowing comparisons of the data itself. buf can be used to store additional data, and it can be assumed to be a cleared buffer.

Object Safety§

This trait is not object safe.

Implementors§