Trait oasis_core_runtime::storage::mkvs::sync::ReadSync

source ·
pub trait ReadSync {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn sync_get(&mut self, request: GetRequest) -> Result<ProofResponse>;
    fn sync_get_prefixes(
        &mut self,
        request: GetPrefixesRequest,
    ) -> Result<ProofResponse>;
    fn sync_iterate(&mut self, request: IterateRequest) -> Result<ProofResponse>;
}
Expand description

ReadSync is the interface for synchronizing the in-memory cache with another (potentially untrusted) MKVS.

Required Methods§

source

fn as_any(&self) -> &dyn Any

Return self as an Any object, useful for downcasting.

source

fn sync_get(&mut self, request: GetRequest) -> Result<ProofResponse>

Fetch a single key and returns the corresponding proof.

source

fn sync_get_prefixes( &mut self, request: GetPrefixesRequest, ) -> Result<ProofResponse>

Fetch all keys under the given prefixes and returns the corresponding proofs.

source

fn sync_iterate(&mut self, request: IterateRequest) -> Result<ProofResponse>

Seek to a given key and then fetch the specified number of following items based on key iteration order.

Implementors§