Module shard

Module shard 

Source

MacrosΒ§

record_hit πŸ”’
record_hit_mut πŸ”’
record_miss πŸ”’
record_miss_mut πŸ”’

StructsΒ§

CacheShard
A bounded cache using a modified CLOCK-PRO eviction policy. The implementation allows some parallelism as gets don’t require exclusive access. Any evicted items are returned so they can be dropped by the caller, outside the locks.
Placeholder πŸ”’
RefMut
Structure wrapping a mutable reference to a cached item. On drop, recomputes weight via the inner WeightGuard.
Resident
WeightGuard πŸ”’
Drop guard for entry_or_placeholder: if the user callback panics after mutating the value, recomputes weight to keep shard accounting consistent.

EnumsΒ§

Entry πŸ”’
EntryAction
What to do with an existing entry after inspection/mutation.
EntryOrPlaceholder
Result of an entry-or-placeholder operation at the shard level.
InsertStrategy
ResidentState πŸ”’

ConstantsΒ§

MAX_F πŸ”’

TraitsΒ§

SharedPlaceholder