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§
sourcetype Output
type Output
Output data produced by compare_blobs()
.
Required Methods§
sourcefn 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>
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.