pub trait AsyncBlobStore:
Debug
+ Send
+ Sync {
// Required methods
fn read_blob(
&self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, String>> + Send + '_>>;
fn write_blob(
&self,
bytes: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + '_>>;
}Expand description
[CR-4] re-export so hosts can build ClientConfig { storage_backend: … } without
pulling ping_mls_store in directly. AsyncBlobStore is the async
single-blob trait WASM hosts implement to back StorageBackend::IndexedDb;
BlobFuture is the matching future-type helper.
Async single-blob storage. Reads + writes the entire MLS snapshot as one
opaque byte slab; the provider takes care of (de)serialising the
MemoryStorage HashMap inside that slab.
Native targets get Send + Sync so the provider can be shared across
tokio threads; WASM drops the bound to match wasm-bindgen + JsFuture
being !Send.
Debug is required so crate::StorageBackend can still derive Debug
without resorting to a manual impl on the enum.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".