Skip to main content

DurableStateBackend

Trait DurableStateBackend 

Source
pub trait DurableStateBackend {
    // Required methods
    fn backend_name(&self) -> &'static str;
    fn ensure_scope(&self, scope: &BackendScope) -> Result<(), VmError>;
    fn resume_scope(&self, scope: &BackendScope) -> Result<(), VmError>;
    fn read(
        &self,
        scope: &BackendScope,
        key: &str,
    ) -> Result<Option<String>, VmError>;
    fn write(
        &self,
        scope: &BackendScope,
        key: &str,
        content: &str,
        options: &BackendWriteOptions,
    ) -> Result<BackendWriteOutcome, VmError>;
    fn delete(&self, scope: &BackendScope, key: &str) -> Result<(), VmError>;
    fn list(&self, scope: &BackendScope) -> Result<Vec<String>, VmError>;
}

Required Methods§

Source

fn backend_name(&self) -> &'static str

Source

fn ensure_scope(&self, scope: &BackendScope) -> Result<(), VmError>

Source

fn resume_scope(&self, scope: &BackendScope) -> Result<(), VmError>

Source

fn read( &self, scope: &BackendScope, key: &str, ) -> Result<Option<String>, VmError>

Source

fn write( &self, scope: &BackendScope, key: &str, content: &str, options: &BackendWriteOptions, ) -> Result<BackendWriteOutcome, VmError>

Source

fn delete(&self, scope: &BackendScope, key: &str) -> Result<(), VmError>

Source

fn list(&self, scope: &BackendScope) -> Result<Vec<String>, VmError>

Implementors§