Skip to main content

MultipartBlobStore

Trait MultipartBlobStore 

Source
pub trait MultipartBlobStore: BlobStore {
    type PartSink: PartSink;

    const MAX_PARTS: u32;

    // Provided methods
    fn supports_multipart(&self) -> bool { ... }
    fn begin_multipart(
        &self,
        _key: BlobKey,
        _len: u64,
        _part_size: u64,
    ) -> impl Future<Output = Result<Vec<u8>, StoreError>> + MaybeSend { ... }
    fn begin_multipart_for_ticket(
        &self,
        key: BlobKey,
        len: u64,
        part_size: u64,
        _ticket_id: [u8; 32],
    ) -> impl Future<Output = Result<Vec<u8>, StoreError>> + MaybeSend { ... }
    fn begin_part(
        &self,
        _key: BlobKey,
        _session: &[u8],
        _plan: &PartPlan,
        _index: u32,
        _expected_cv: [u8; 32],
    ) -> impl Future<Output = Result<Self::PartSink, StoreError>> + MaybeSend { ... }
    fn complete(
        &self,
        _key: BlobKey,
        _session: &[u8],
        _plan: &PartPlan,
        _parts: &[PartRef],
    ) -> impl Future<Output = Result<CommitOutcome, StoreError>> + MaybeSend { ... }
    fn complete_with_root(
        &self,
        _key: BlobKey,
        _session: &[u8],
        _plan: &PartPlan,
        _parts: &[PartRef],
        _content_root: Hash,
    ) -> impl Future<Output = Result<CommitOutcome, StoreError>> + MaybeSend { ... }
    fn single_put_limit(&self) -> Option<u64> { ... }
    fn abort(
        &self,
        _key: BlobKey,
        _session: &[u8],
    ) -> impl Future<Output = Result<(), StoreError>> + MaybeSend { ... }
}
Expand description

A resumable blob store with opaque storage sessions and verified parts.

Required Associated Constants§

Source

const MAX_PARTS: u32

Maximum part count accepted by this backend.

Required Associated Types§

Source

type PartSink: PartSink

The upload handle returned by Self::begin_part.

Provided Methods§

Source

fn supports_multipart(&self) -> bool

Whether this backend can start a multipart upload now.

Source

fn begin_multipart( &self, _key: BlobKey, _len: u64, _part_size: u64, ) -> impl Future<Output = Result<Vec<u8>, StoreError>> + MaybeSend

Open a new storage session for a pack.

Source

fn begin_multipart_for_ticket( &self, key: BlobKey, len: u64, part_size: u64, _ticket_id: [u8; 32], ) -> impl Future<Output = Result<Vec<u8>, StoreError>> + MaybeSend

Open a session for a known ticket. Backends that do not use the ticket id as their storage session keep their existing session format.

Source

fn begin_part( &self, _key: BlobKey, _session: &[u8], _plan: &PartPlan, _index: u32, _expected_cv: [u8; 32], ) -> impl Future<Output = Result<Self::PartSink, StoreError>> + MaybeSend

Start one part in an existing storage session.

Source

fn complete( &self, _key: BlobKey, _session: &[u8], _plan: &PartPlan, _parts: &[PartRef], ) -> impl Future<Output = Result<CommitOutcome, StoreError>> + MaybeSend

Atomically make the verified pack visible.

Source

fn complete_with_root( &self, _key: BlobKey, _session: &[u8], _plan: &PartPlan, _parts: &[PartRef], _content_root: Hash, ) -> impl Future<Output = Result<CommitOutcome, StoreError>> + MaybeSend

Atomically make a verified object visible: the parts’ merged BLAKE3 root must equal content_root (the object key is an object id, not a content hash). Plain Self::complete refuses object keys, as PackSink::commit does. WP-4.10.

Source

fn single_put_limit(&self) -> Option<u64>

The most bytes one BlobStore::begin upload can carry, or None when unbounded. Objects longer than this are extracted in parts.

Source

fn abort( &self, _key: BlobKey, _session: &[u8], ) -> impl Future<Output = Result<(), StoreError>> + MaybeSend

Reclaim an incomplete session. Repeated aborts succeed.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§