Crate foyer

Source
Expand description

A hybrid cache library that supports plug-and-play cache algorithms, in-memory cache and disk cache.

Website Crates.io Version docs.rs

Website | Tutorial | API Docs | Crate

Structs§

AdmitAllPicker
A picker that always returns true.
CacheBuilder
In-memory cache builder.
CacheProperties
Entry properties for in-memory only cache.
ChainedAdmissionPicker
Only admit on all chained admission pickers pick.
ChainedAdmissionPickerBuilder
A builder for ChainedAdmissionPicker.
DirectFileDevice
A device that uses a single direct i/o file.
DirectFileDeviceOptions
DirectFileDeviceOptions is used to build the options for the direct fs device.
DirectFsDevice
A device that uses direct i/o files in a directory of a file system.
DirectFsDeviceOptions
DirectFsDeviceOptions is used to build the options for the direct fs device.
EvictionInfo
Eviction related information for eviction picker to make decisions.
FifoConfig
Fifo eviction algorithm config.
FifoPicker
A picker that pick region to eviction with a FIFO behavior.
HybridCache
Hybrid cache that integrates in-memory cache and disk cache.
HybridCacheBuilder
Hybrid cache builder.
HybridCacheBuilderPhaseMemory
Hybrid cache builder to modify the in-memory cache configurations.
HybridCacheBuilderPhaseStorage
Hybrid cache builder modify the disk cache configurations.
HybridCacheProperties
Entry properties for in-memory only cache.
HybridCacheStorageWriter
Writer for disk cache of a hybrid cache to support more flexible write APIs.
HybridCacheWriter
Writer for hybrid cache to support more flexible write APIs.
InvalidRatioPicker
Evict the region with the largest invalid data ratio.
LargeEngineOptions
Large object disk cache engine default options.
LfuConfig
w-TinyLFU eviction algorithm config.
LruConfig
Lru eviction algorithm config.
Region
A region is a logical partition of a device. It is used to manage the device’s storage space.
RegionStatistics
Region statistics.
RejectAllPicker
A picker that always returns false.
Runtime
Runtime holds the runtime reference and non-cloneable handles to prevent handle usage after runtime shutdown.
S3FifoConfig
S3Fifo eviction algorithm config.
SmallEngineOptions
Small object disk cache engine default options.
Statistics
The statistics of the disk cache, which is used by the pickers.
Store
The disk cache engine that serves as the storage backend of foyer.
StoreBuilder
The builder of the disk cache.
Throttle
Throttle config for the device.
TokioRuntimeOptions
Tokio runtime configuration.
TombstoneLogConfigBuilder
The builder for the tombstone log config.
TracingOptions
Options for tracing.

Enums§

Age
Entry age in the disk cache. Used by hybrid cache.
Cache
In-memory cache with plug-and-play algorithms.
CacheEntry
A cached entry holder of the in-memory cache.
CodeError
Code error.
Compression
The compression algorithm of the disk cache.
Engine
Engine controls the ratio of the large object disk cache and the small object disk cache.
Event
Event identifier.
EvictionConfig
Eviction algorithm config.
FetchState
The state of fetch.
Hint
Hint for the cache eviction algorithm to decide the priority of the specific entry if needed.
HybridCachePolicy
Control the cache policy of the hybrid cache.
IopsCounter
Device iops counter.
Load
Load result.
Location
Advice cache location for the cache entry.
Pick
Pick result for admission pickers and reinsertion pickers.
RecoverMode
The recover mode of the disk cache.
RuntimeOptions
Options for the dedicated runtime.
Source
Entry source used by hybrid cache.

Traits§

AdmissionPicker
The admission picker for the disk cache.
BufExt
Extend Buf with get_isize() and get_usize().
BufMutExt
Extend BufMut with put_isize() and put_usize().
Code
Encode/decode trait for key and value.
Dev
Dev represents 4K aligned block device.
DevConfig
Config for the device.
DevExt
Device extend interfaces.
EventListener
Trait for the customized event listener.
EvictionPicker
The eviction picker for the disk cache.
Key
Key trait for the in-memory cache.
OptionExt
Extension for std::option::Option.
RangeBoundsExt
The range extensions.
ReinsertionPicker
The reinsertion picker for the disk cache.
Scope
Scoped functional programming extensions.
Storage
The storage trait for the disk cache storage engine.
StorageKey
Key trait for the disk cache.
StorageValue
Value trait for the disk cache.
Value
Value trait for the in-memory cache.
Weighter
The weighter for the in-memory cache.

Type Aliases§

CodeResult
Code Result.
DefaultHasher
The default hasher for foyer.
HybridCacheEntry
A cached entry holder of the hybrid cache.
HybridFetch
The future generated by HybridCache::fetch.