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§
Sourcefn contract(&self) -> &StoreContract
fn contract(&self) -> &StoreContract
The store’s contract; prepare compares it with the plan’s.
Sourcefn get<'a>(
&'a self,
namespace: &'a str,
scope: &'a str,
key_id: &'a str,
call: StoreCall,
) -> BoxFuture<'a, Result<Stored, StoreFailure>>
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.
Sourcefn put<'a>(
&'a self,
namespace: &'a str,
key_id: &'a str,
bytes: Vec<u8>,
terms: PutTerms,
call: StoreCall,
) -> BoxFuture<'a, Result<PutAnswer, 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>>
Store bytes under key_id if terms still hold.
Sourcefn delete<'a>(
&'a self,
namespace: &'a str,
key_id: &'a str,
call: StoreCall,
) -> BoxFuture<'a, Result<(), StoreFailure>>
fn delete<'a>( &'a self, namespace: &'a str, key_id: &'a str, call: StoreCall, ) -> BoxFuture<'a, Result<(), StoreFailure>>
Remove one entry.
Sourcefn invalidate<'a>(
&'a self,
namespace: &'a str,
selector: StoreSelector,
call: StoreCall,
) -> BoxFuture<'a, Result<Invalidated, StoreFailure>>
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".