pub struct FileDeduper<DataInterfaceType: DeduplicationDataInterface> { /* private fields */ }Implementations§
Source§impl<DataInterfaceType: DeduplicationDataInterface> FileDeduper<DataInterfaceType>
impl<DataInterfaceType: DeduplicationDataInterface> FileDeduper<DataInterfaceType>
pub fn new(data_manager: DataInterfaceType, file_id: u64) -> Self
pub async fn process_chunks( &mut self, chunks: &[Chunk], ) -> Result<DeduplicationMetrics, DataInterfaceType::ErrorType>
Sourcepub fn finalize(
self,
metadata_ext: Option<FileMetadataExt>,
) -> (MerkleHash, DataAggregator, DeduplicationMetrics)
pub fn finalize( self, metadata_ext: Option<FileMetadataExt>, ) -> (MerkleHash, DataAggregator, DeduplicationMetrics)
Finalize the internal state, converting remaining data to a DataAggregator object that contains the file info and remaining data. Also returns the aggregated deduplication metrics and the list of xorb hashes that were registered as part of this run.
Returns (file hash, data aggregation, deduplication metrics)
Auto Trait Implementations§
impl<DataInterfaceType> Freeze for FileDeduper<DataInterfaceType>where
DataInterfaceType: Freeze,
impl<DataInterfaceType> RefUnwindSafe for FileDeduper<DataInterfaceType>where
DataInterfaceType: RefUnwindSafe,
impl<DataInterfaceType> Send for FileDeduper<DataInterfaceType>
impl<DataInterfaceType> Sync for FileDeduper<DataInterfaceType>
impl<DataInterfaceType> Unpin for FileDeduper<DataInterfaceType>where
DataInterfaceType: Unpin,
impl<DataInterfaceType> UnsafeUnpin for FileDeduper<DataInterfaceType>where
DataInterfaceType: UnsafeUnpin,
impl<DataInterfaceType> UnwindSafe for FileDeduper<DataInterfaceType>where
DataInterfaceType: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more