pub struct SingleFileCleaner { /* private fields */ }Expand description
A class that encapsulates the clean and data task around a single file.
Implementations§
Source§impl SingleFileCleaner
impl SingleFileCleaner
pub async fn add_data(&mut self, data: &[u8]) -> Result<()>
pub async fn add_data_from_bytes(&mut self, data: Bytes) -> Result<()>
Sourcepub async fn checkpoint(&mut self) -> Result<()>
pub async fn checkpoint(&mut self) -> Result<()>
Ensures all current background work is completed.
Sourcepub async fn finish(self) -> Result<(XetFileInfo, DeduplicationMetrics)>
pub async fn finish(self) -> Result<(XetFileInfo, DeduplicationMetrics)>
Return the representation of the file after clean as a pointer file instance.
Sourcepub async fn finish_with_chunks(
self,
) -> Result<(XetFileInfo, ChunkHashList, DeduplicationMetrics)>
pub async fn finish_with_chunks( self, ) -> Result<(XetFileInfo, ChunkHashList, DeduplicationMetrics)>
Same as [finish], but also returns the per-chunk hash list produced during CDC.
Only needed by composition flows (e.g. upload_ranges) that build partial
MerkleHashSubtree nodes for newly-uploaded windows; regular uploads should call
[finish] instead.
Sourcepub async fn finish_with_chunks_detached(
self,
) -> Result<(XetFileInfo, ChunkHashList, MDBFileInfo, DeduplicationMetrics)>
pub async fn finish_with_chunks_detached( self, ) -> Result<(XetFileInfo, ChunkHashList, MDBFileInfo, DeduplicationMetrics)>
Like finish_with_chunks, but does NOT register the file’s MDBFileInfo in the
session shard. Returns the MDBFileInfo directly so the caller can compose it into a
larger file without creating orphan shard entries.
Auto Trait Implementations§
impl !RefUnwindSafe for SingleFileCleaner
impl !Sync for SingleFileCleaner
impl !UnwindSafe for SingleFileCleaner
impl Freeze for SingleFileCleaner
impl Send for SingleFileCleaner
impl Unpin for SingleFileCleaner
impl UnsafeUnpin for SingleFileCleaner
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