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§
- Cacheable
KvStore - A read-through cache adapter that wraps a
KvStorewith aCache. - Write
Back Cache - A cache adapter that defers writes to the backing
KvStore. - Write
Through Cache - A cache adapter that propagates writes to a backing
KvStoreimmediately.