pub trait BlobCache: Clone {
// Required methods
fn insert(
&self,
vlog_id: ValueLogId,
vhandle: &ValueHandle,
value: UserValue,
);
fn get(
&self,
vlog_id: ValueLogId,
vhandle: &ValueHandle,
) -> Option<UserValue>;
}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§
Sourcefn insert(&self, vlog_id: ValueLogId, vhandle: &ValueHandle, value: UserValue)
fn insert(&self, vlog_id: ValueLogId, vhandle: &ValueHandle, value: UserValue)
Caches a blob.
Sourcefn get(&self, vlog_id: ValueLogId, vhandle: &ValueHandle) -> Option<UserValue>
fn get(&self, vlog_id: ValueLogId, vhandle: &ValueHandle) -> Option<UserValue>
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.