Skip to main content

PartSink

Trait PartSink 

Source
pub trait PartSink: MaybeSend {
    // Required methods
    fn write(
        &mut self,
        chunk: Bytes,
    ) -> impl Future<Output = Result<(), StoreError>> + MaybeSend;
    fn commit(
        self,
    ) -> impl Future<Output = Result<Vec<u8>, StoreError>> + MaybeSend;
    fn abort(self) -> impl Future<Output = ()> + MaybeSend;
}
Expand description

A verified, staged part. commit makes only this part durable; the pack remains invisible until MultipartBlobStore::complete.

Required Methods§

Source

fn write( &mut self, chunk: Bytes, ) -> impl Future<Output = Result<(), StoreError>> + MaybeSend

Append a non-empty chunk without exceeding the part’s expected length.

Source

fn commit(self) -> impl Future<Output = Result<Vec<u8>, StoreError>> + MaybeSend

Verify length and subtree CV, then return an opaque backend tag. A CV mismatch is StoreError::PartSubtreeMismatch; other invalid staged state is StoreError::Invalid.

Source

fn abort(self) -> impl Future<Output = ()> + MaybeSend

Discard this attempted part.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§