Skip to main content

RuntimeStore

Trait RuntimeStore 

Source
pub trait RuntimeStore: Send + Sync {
    // Required methods
    fn contract(&self) -> &StoreContract;
    fn get<'a>(
        &'a self,
        namespace: &'a str,
        scope: &'a str,
        key_id: &'a str,
        call: StoreCall,
    ) -> BoxFuture<'a, Result<Stored, StoreFailure>>;
    fn put<'a>(
        &'a self,
        namespace: &'a str,
        key_id: &'a str,
        bytes: Vec<u8>,
        terms: PutTerms,
        call: StoreCall,
    ) -> BoxFuture<'a, Result<PutAnswer, StoreFailure>>;
    fn delete<'a>(
        &'a self,
        namespace: &'a str,
        key_id: &'a str,
        call: StoreCall,
    ) -> BoxFuture<'a, Result<(), StoreFailure>>;
    fn invalidate<'a>(
        &'a self,
        namespace: &'a str,
        selector: StoreSelector,
        call: StoreCall,
    ) -> BoxFuture<'a, Result<Invalidated, StoreFailure>>;
}
Expand description

A host-implemented store (3.4.1). Every call is polled on the task of the decision that made it.

Required Methods§

Source

fn contract(&self) -> &StoreContract

The store’s contract; prepare compares it with the plan’s.

Source

fn get<'a>( &'a self, namespace: &'a str, scope: &'a str, key_id: &'a str, call: StoreCall, ) -> BoxFuture<'a, Result<Stored, StoreFailure>>

The entry under key_id, if any, and the namespace and scope generations, read atomically.

Source

fn put<'a>( &'a self, namespace: &'a str, key_id: &'a str, bytes: Vec<u8>, terms: PutTerms, call: StoreCall, ) -> BoxFuture<'a, Result<PutAnswer, StoreFailure>>

Store bytes under key_id if terms still hold.

Source

fn delete<'a>( &'a self, namespace: &'a str, key_id: &'a str, call: StoreCall, ) -> BoxFuture<'a, Result<(), StoreFailure>>

Remove one entry.

Source

fn invalidate<'a>( &'a self, namespace: &'a str, selector: StoreSelector, call: StoreCall, ) -> BoxFuture<'a, Result<Invalidated, StoreFailure>>

Atomically advance the selected generation and make the entries it covers unreadable.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§