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§
Sourcefn get(
&self,
container: &str,
name: &str,
) -> impl Future<Output = Result<Option<Vec<u8>>>> + Send
fn get( &self, container: &str, name: &str, ) -> impl Future<Output = Result<Option<Vec<u8>>>> + Send
Retrieve an object’s data from a container.
Sourcefn put(
&self,
container: &str,
name: &str,
data: &[u8],
) -> impl Future<Output = Result<()>> + Send
fn put( &self, container: &str, name: &str, data: &[u8], ) -> impl Future<Output = Result<()>> + Send
Store an object in a container.
Sourcefn delete(
&self,
container: &str,
name: &str,
) -> impl Future<Output = Result<()>> + Send
fn delete( &self, container: &str, name: &str, ) -> impl Future<Output = Result<()>> + Send
Delete an object from a container.
Sourcefn has(
&self,
container: &str,
name: &str,
) -> impl Future<Output = Result<bool>> + Send
fn has( &self, container: &str, name: &str, ) -> impl Future<Output = Result<bool>> + Send
Check whether an object exists in a container.
Sourcefn list(
&self,
container: &str,
) -> impl Future<Output = Result<Vec<String>>> + Send
fn list( &self, container: &str, ) -> impl Future<Output = Result<Vec<String>>> + Send
List all object names in a container.
Sourcefn get_range(
&self,
container: &str,
name: &str,
start: u64,
end: u64,
) -> impl Future<Output = Result<Vec<u8>>> + Send
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.
Sourcefn object_info(
&self,
container: &str,
name: &str,
) -> impl Future<Output = Result<ObjectMetadata>> + Send
fn object_info( &self, container: &str, name: &str, ) -> impl Future<Output = Result<ObjectMetadata>> + Send
Return metadata for an object.
Sourcefn delete_objects(
&self,
container: &str,
names: &[String],
) -> impl Future<Output = Result<()>> + Send
fn delete_objects( &self, container: &str, names: &[String], ) -> impl Future<Output = Result<()>> + Send
Delete multiple objects from a container.
Sourcefn clear(&self, container: &str) -> impl Future<Output = Result<()>> + Send
fn clear(&self, container: &str) -> impl Future<Output = Result<()>> + Send
Remove all objects from a container, leaving it empty.
Sourcefn create_container(
&self,
name: &str,
) -> impl Future<Output = Result<()>> + Send
fn create_container( &self, name: &str, ) -> impl Future<Output = Result<()>> + Send
Create a new empty container.
Sourcefn delete_container(
&self,
name: &str,
) -> impl Future<Output = Result<()>> + Send
fn delete_container( &self, name: &str, ) -> impl Future<Output = Result<()>> + Send
Delete a container and all objects within it.
Sourcefn container_exists(
&self,
name: &str,
) -> impl Future<Output = Result<bool>> + Send
fn container_exists( &self, name: &str, ) -> impl Future<Output = Result<bool>> + Send
Check whether a container exists.
Sourcefn container_info(
&self,
container: &str,
) -> impl Future<Output = Result<ContainerMetadata>> + Send
fn container_info( &self, container: &str, ) -> impl Future<Output = Result<ContainerMetadata>> + Send
Return metadata for a container.
Sourcefn copy_object(
&self,
src_container: &str,
src_name: &str,
dest_container: &str,
dest_name: &str,
) -> impl Future<Output = Result<()>> + Send
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.
Sourcefn move_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
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.