pub struct SyncChunkAssembler { /* private fields */ }Expand description
Bounded assembler for out-of-order and resumable sync chunks.
Implementations§
Source§impl SyncChunkAssembler
impl SyncChunkAssembler
Sourcepub fn new(
transfer_id: impl Into<String>,
total_bytes: u64,
payload_sha256: impl Into<String>,
) -> SyncResult<Self>
pub fn new( transfer_id: impl Into<String>, total_bytes: u64, payload_sha256: impl Into<String>, ) -> SyncResult<Self>
Creates an empty assembler for one logical transfer.
Sourcepub fn insert(&mut self, chunk: SyncPayloadChunk) -> SyncResult<SyncChunkInsert>
pub fn insert(&mut self, chunk: SyncPayloadChunk) -> SyncResult<SyncChunkInsert>
Inserts one chunk, accepting an identical replay idempotently.
Sourcepub fn progress(&self) -> SyncChunkProgress
pub fn progress(&self) -> SyncChunkProgress
Returns bounded, payload-free progress and missing ranges.
Sourcepub fn assemble(&self) -> SyncResult<Vec<u8>>
pub fn assemble(&self) -> SyncResult<Vec<u8>>
Assembles the payload only after every byte is present and verified.
Trait Implementations§
Source§impl Clone for SyncChunkAssembler
impl Clone for SyncChunkAssembler
Source§impl Debug for SyncChunkAssembler
impl Debug for SyncChunkAssembler
impl Eq for SyncChunkAssembler
Source§impl PartialEq for SyncChunkAssembler
impl PartialEq for SyncChunkAssembler
impl StructuralPartialEq for SyncChunkAssembler
Auto Trait Implementations§
impl Freeze for SyncChunkAssembler
impl RefUnwindSafe for SyncChunkAssembler
impl Send for SyncChunkAssembler
impl Sync for SyncChunkAssembler
impl Unpin for SyncChunkAssembler
impl UnsafeUnpin for SyncChunkAssembler
impl UnwindSafe for SyncChunkAssembler
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