pub trait AsyncBlobStore {
type Error: Error + 'static;
// Required methods
async fn get_blob(
&self,
reference: &BlobRef,
) -> Result<Option<Vec<u8>>, Self::Error>;
async fn put_blob(&self, bytes: &[u8]) -> Result<BlobRef, Self::Error>;
async fn delete_blob(&self, reference: &BlobRef) -> Result<(), Self::Error>;
// Provided methods
fn read_parallelism(&self) -> usize { ... }
async fn get_blobs_ordered(
&self,
references: &[BlobRef],
) -> Result<Vec<Option<Vec<u8>>>, Self::Error> { ... }
}Expand description
Async content-addressed blob storage used by large-value helpers.
This trait mirrors BlobStore for object stores, remote caches, browser
storage, and other non-blocking blob backends. Like crate::AsyncStore,
it does not require Send or Sync at the trait level so single-threaded
WASM stores can implement it.
Required Associated Types§
Required Methods§
Sourceasync fn get_blob(
&self,
reference: &BlobRef,
) -> Result<Option<Vec<u8>>, Self::Error>
async fn get_blob( &self, reference: &BlobRef, ) -> Result<Option<Vec<u8>>, Self::Error>
Load a blob by reference.
Provided Methods§
Sourcefn read_parallelism(&self) -> usize
fn read_parallelism(&self) -> usize
Maximum in-flight point reads for default ordered blob reads.
Sourceasync fn get_blobs_ordered(
&self,
references: &[BlobRef],
) -> Result<Vec<Option<Vec<u8>>>, Self::Error>
async fn get_blobs_ordered( &self, references: &[BlobRef], ) -> Result<Vec<Option<Vec<u8>>>, Self::Error>
Retrieve multiple blobs while preserving request order.
The default implementation deduplicates repeated references, performs
point reads, and expands results back to the original request order. If
AsyncBlobStore::read_parallelism is greater than one, point reads are
overlapped up to that limit.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".