Skip to main content

BlobStore

Trait BlobStore 

Source
pub trait BlobStore: Send + Sync {
Show 15 methods // Required methods fn get( &self, container: &str, name: &str, ) -> impl Future<Output = Result<Option<Vec<u8>>>> + Send; fn put( &self, container: &str, name: &str, data: &[u8], ) -> impl Future<Output = Result<()>> + Send; fn delete( &self, container: &str, name: &str, ) -> impl Future<Output = Result<()>> + Send; fn has( &self, container: &str, name: &str, ) -> impl Future<Output = Result<bool>> + Send; fn list( &self, container: &str, ) -> impl Future<Output = Result<Vec<String>>> + Send; fn get_range( &self, container: &str, name: &str, start: u64, end: u64, ) -> impl Future<Output = Result<Vec<u8>>> + Send; fn object_info( &self, container: &str, name: &str, ) -> impl Future<Output = Result<ObjectMetadata>> + Send; fn delete_objects( &self, container: &str, names: &[String], ) -> impl Future<Output = Result<()>> + Send; fn clear(&self, container: &str) -> impl Future<Output = Result<()>> + Send; fn create_container( &self, name: &str, ) -> impl Future<Output = Result<()>> + Send; fn delete_container( &self, name: &str, ) -> impl Future<Output = Result<()>> + Send; fn container_exists( &self, name: &str, ) -> impl Future<Output = Result<bool>> + Send; fn container_info( &self, container: &str, ) -> impl Future<Output = Result<ContainerMetadata>> + Send; fn copy_object( &self, src_container: &str, src_name: &str, dest_container: &str, dest_name: &str, ) -> impl Future<Output = Result<()>> + Send; fn move_object( &self, src_container: &str, src_name: &str, dest_container: &str, dest_name: &str, ) -> impl Future<Output = Result<()>> + Send;
}
Expand description

Binary large object storage (WASI Blobstore).

Default WASM implementations delegate to wasi:blobstore via omnia-wasi-blobstore.

Required Methods§

Source

fn get( &self, container: &str, name: &str, ) -> impl Future<Output = Result<Option<Vec<u8>>>> + Send

Retrieve an object’s data from a container.

Source

fn put( &self, container: &str, name: &str, data: &[u8], ) -> impl Future<Output = Result<()>> + Send

Store an object in a container.

Source

fn delete( &self, container: &str, name: &str, ) -> impl Future<Output = Result<()>> + Send

Delete an object from a container.

Source

fn has( &self, container: &str, name: &str, ) -> impl Future<Output = Result<bool>> + Send

Check whether an object exists in a container.

Source

fn list( &self, container: &str, ) -> impl Future<Output = Result<Vec<String>>> + Send

List all object names in a container.

Source

fn get_range( &self, container: &str, name: &str, start: u64, end: u64, ) -> impl Future<Output = Result<Vec<u8>>> + Send

Retrieve a byte range of an object’s data.

Both start and end offsets are inclusive.

Source

fn object_info( &self, container: &str, name: &str, ) -> impl Future<Output = Result<ObjectMetadata>> + Send

Return metadata for an object.

Source

fn delete_objects( &self, container: &str, names: &[String], ) -> impl Future<Output = Result<()>> + Send

Delete multiple objects from a container.

Source

fn clear(&self, container: &str) -> impl Future<Output = Result<()>> + Send

Remove all objects from a container, leaving it empty.

Source

fn create_container( &self, name: &str, ) -> impl Future<Output = Result<()>> + Send

Create a new empty container.

Source

fn delete_container( &self, name: &str, ) -> impl Future<Output = Result<()>> + Send

Delete a container and all objects within it.

Source

fn container_exists( &self, name: &str, ) -> impl Future<Output = Result<bool>> + Send

Check whether a container exists.

Source

fn container_info( &self, container: &str, ) -> impl Future<Output = Result<ContainerMetadata>> + Send

Return metadata for a container.

Source

fn copy_object( &self, src_container: &str, src_name: &str, dest_container: &str, dest_name: &str, ) -> impl Future<Output = Result<()>> + Send

Copy an object to the same or a different container.

Overwrites the destination object if it already exists. Returns an error if the destination container does not exist.

Source

fn move_object( &self, src_container: &str, src_name: &str, dest_container: &str, dest_name: &str, ) -> impl Future<Output = Result<()>> + Send

Move or rename an object to the same or a different container.

Overwrites the destination object if it already exists. Returns an error if the destination container does not exist.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§