Trait BlobCache

Source
pub trait BlobCache: Clone {
    // Required methods
    fn insert(&self, vlog_id: u64, vhandle: &ValueHandle, value: Slice);
    fn get(&self, vlog_id: u64, vhandle: &ValueHandle) -> Option<Slice>;
}
Expand description

Blob cache, in which blobs are cached in-memory after being retrieved from disk

This speeds up consecutive accesses to the same blobs, improving read performance for hot data.

Required Methods§

Source

fn insert(&self, vlog_id: u64, vhandle: &ValueHandle, value: Slice)

Caches a blob.

Source

fn get(&self, vlog_id: u64, vhandle: &ValueHandle) -> Option<Slice>

Retrieves a blob from the cache, or None if it could not be found.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§