ObjectStoreHostBinding

Struct ObjectStoreHostBinding 

Source
pub struct ObjectStoreHostBinding { /* private fields */ }
Expand description

An abstraction around a host runtime capability for a key-value store

Implementations§

Source§

impl ObjectStoreHostBinding

Source

pub fn create_container(&self, name: &str) -> HandlerResult<Container>

Creates a new container within the store

Source

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.

Source

pub fn remove_object(&self, name: &str, container: &str) -> HandlerResult<()>

Removes an object from a container

Source

pub fn list_objects(&self, container: &str) -> HandlerResult<BlobList>

Lists all objects within a container

Source

pub fn get_blob_info( &self, container: &str, id: &str, ) -> HandlerResult<Option<Blob>>

Obtains binary object metadata, does not include the object bytes

Source

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

Source

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.

Source

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.

Trait Implementations§

Source§

impl Default for ObjectStoreHostBinding

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.