Crate foyer

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§

AdmitAll
Admit all entries.
Block
A block is a logical partition of a device. It is used to manage the device’s storage space.
BlockEngineBuilder
Builder for the block-based disk cache engine.
BlockStatistics
Block statistics.
CacheBuilder
In-memory cache builder.
CacheProperties
Entry properties for in-memory only cache.
CombinedDeviceBuilder
Builder for a combined device that wraps multiple devices and allows access to their blocks.
EngineBuildContext
Context for building the disk cache engine.
EstimatedSize
A condition that checks if the estimated size is within a specified range.
EvictionInfo
Eviction related information for eviction picker to make decisions.
FifoConfig
Fifo eviction algorithm config.
FifoPicker
A picker that pick block to eviction with a FIFO behavior.
FileDeviceBuilder
Builder for a file-based device that manages a single file or a raw block device.
FsDeviceBuilder
Builder for a filesystem-based device that manages files in a directory.
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 block with the largest invalid data ratio.
IoHandle
A detached I/O handle that can be polled for completion.
LfuConfig
w-TinyLFU eviction algorithm config.
LruConfig
Lru eviction algorithm config.
NoopDeviceBuilder
Builder for a no-operation mock device.
NoopIoEngine
A mock I/O engine that does nothing.
NoopIoEngineBuilder
Builder for a no-operation mock I/O engine.
PartialDeviceBuilder
Builder for a partial device that wraps another device and allows access to only a subset of capacity.
PsyncIoEngine
The synchronous I/O engine that uses pread(2)/pwrite(2) and tokio thread pool for reading and writing.
PsyncIoEngineBuilder
Builder for synchronous I/O engine with pread(2)/pwrite(2).
RawFile
Raw os file resource.
RejectAll
Reject all entries.
Runtime
Runtime holds the runtime reference and non-cloneable handles to prevent handle usage after runtime shutdown.
S3FifoConfig
S3Fifo eviction algorithm config.
Statistics
The statistics of the device.
StorageFilter
StorageFilter filters entries based on multiple conditions for admission and reinsertion.
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.
TracingOptions
Options for tracing.
UringIoEngine
The io_uring based I/O engine.
UringIoEngineBuilder
Builder for io_uring based I/O engine.

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.
Error
Errors enum for foyer.
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.
IoError
I/O related error from foyer disk cache io module.
IopsCounter
Device iops counter.
Load
Load result.
Location
Advice cache location for the cache entry.
RecoverMode
The recover mode of the disk cache.
RuntimeOptions
Options for the dedicated runtime.
Source
Entry source used by hybrid cache.
StorageFilterResult
Filter result for admission pickers and reinsertion pickers.

Traits§

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.
Device
Device trait.
DeviceBuilder
Device builder trait.
Engine
Disk cache engine trait.
EngineConfig
Disk cache engine builder trait.
EventListener
Trait for the customized event listener.
EvictionPicker
The eviction picker for the disk cache.
Filter
The filter for the in-memory cache.
IoEngine
I/O engine builder trait.
IoEngineBuilder
I/O engine builder trait.
Key
Key trait for the in-memory cache.
OptionExt
Extension for std::option::Option.
RangeBoundsExt
The range extensions.
Scope
Scoped functional programming extensions.
StorageFilterCondition
Condition for StorageFilter.
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.
IoResult
I/O related result type.
Result
Result type for foyer.