Skip to main content

ReadSync

Trait 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.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§