pub struct ObjectStoreHostBinding { /* private fields */ }Expand description
An abstraction around a host runtime capability for a key-value store
Implementations§
Source§impl ObjectStoreHostBinding
impl ObjectStoreHostBinding
Sourcepub fn create_container(&self, name: &str) -> HandlerResult<Container>
pub fn create_container(&self, name: &str) -> HandlerResult<Container>
Creates a new container within the store
Sourcepub fn remove_container(&self, name: &str) -> HandlerResult<()>
pub fn remove_container(&self, name: &str) -> HandlerResult<()>
Removes a container from the store. Whether or not this will fail if the container has items may be specific to a given provider implementation.
Sourcepub fn remove_object(&self, name: &str, container: &str) -> HandlerResult<()>
pub fn remove_object(&self, name: &str, container: &str) -> HandlerResult<()>
Removes an object from a container
Sourcepub fn list_objects(&self, container: &str) -> HandlerResult<BlobList>
pub fn list_objects(&self, container: &str) -> HandlerResult<BlobList>
Lists all objects within a container
Sourcepub fn get_blob_info(
&self,
container: &str,
id: &str,
) -> HandlerResult<Option<Blob>>
pub fn get_blob_info( &self, container: &str, id: &str, ) -> HandlerResult<Option<Blob>>
Obtains binary object metadata, does not include the object bytes
Sourcepub fn start_upload(
&self,
blob: &Blob,
chunk_size: u64,
total_bytes: u64,
) -> HandlerResult<Transfer>
pub fn start_upload( &self, blob: &Blob, chunk_size: u64, total_bytes: u64, ) -> HandlerResult<Transfer>
Indicates that an upload is about to begin for an item. You should follow this
call up with a for loop/iteration that sends successive chunks to the store. The chunk
size specified in this call is a request or suggestion. It is up to the provider to determine
the actual chunk size, which is returned in the resulting Transfer instance
Sourcepub fn upload_chunk(
&self,
transfer: &Transfer,
offset: u64,
bytes: &[u8],
) -> HandlerResult<()>
pub fn upload_chunk( &self, transfer: &Transfer, offset: u64, bytes: &[u8], ) -> HandlerResult<()>
Uploads an individual chunk of a file to the blob store. This call must only ever
come after signaling the start of a new upload with the start_upload function.
Sourcepub fn start_download(
&self,
blob: &Blob,
chunk_size: u64,
context: Option<String>,
) -> HandlerResult<Transfer>
pub fn start_download( &self, blob: &Blob, chunk_size: u64, context: Option<String>, ) -> HandlerResult<Transfer>
Sends a request to the provider to begin a chunked download of a file. If this
succeeds, your actor will begin receiving OP_RECEIVE_CHUNK messages from the
provider.