Skip to main content

Module write_behind_cache

Module write_behind_cache 

Source
Expand description

Write-behind (write-back) cache with dirty tracking and flush.

This module provides a cache that batches writes and lazily flushes dirty entries to a backing store. Entries are marked dirty on insert/update; the caller periodically calls WriteBehindCache::flush (or flush_if_needed) to persist dirty entries.

The backing store is abstracted via the BackingStore trait so the same cache can sit in front of an in-memory map, a file, or a network service.

Structs§

WriteBehindCache
Write-behind cache that defers writes to a BackingStore until flush is called.
WriteBehindStats
Snapshot of write-behind cache statistics.

Enums§

WriteBehindError
Errors that can occur during write-behind cache operations.

Traits§

BackingStore
Abstraction over the origin data store that the cache sits in front of.