Skip to main content

Module write_adapter

Module write_adapter 

Source
Expand description

Write-through and write-back cache adapters. Write-through and write-back cache adapters.

Both adapters combine a Cache<Vec<u8>, Vec<u8>> with an oxistore_core::KvStore to provide transparent persistence.

§Write-Through

WriteThroughCache ensures every put is immediately written to the backing store. Cache misses on get are populated from the store.

§Write-Back

WriteBackCache writes to the cache immediately but defers flushing to the store until an explicit WriteBackCache::flush call. If the inner cache evicts a dirty entry, the entry is flushed to the store synchronously to avoid silent data loss.

Structs§

CacheableKvStore
A read-through cache adapter that wraps a KvStore with a Cache.
WriteBackCache
A cache adapter that defers writes to the backing KvStore.
WriteThroughCache
A cache adapter that propagates writes to a backing KvStore immediately.