pub struct HeaderCache { /* private fields */ }Expand description
A per-mount cache of resolved files keyed by track id; an entry
self-invalidates when the track’s content_version changes. Backed by
quick_cache: S3-FIFO eviction, byte-weighted, internally sharded.
Implementations§
Source§impl HeaderCache
impl HeaderCache
pub fn new(mode: Mode) -> HeaderCache
pub fn with_budget(mode: Mode, budget: u64) -> HeaderCache
Sourcepub fn retain(&self, live: &HashSet<i64>)
pub fn retain(&self, live: &HashSet<i64>)
Drop cached resolutions for tracks no longer present (live = current ids).
Sourcepub fn remove(&self, id: i64)
pub fn remove(&self, id: i64)
Drop one track’s cached resolution (changelog-refresh removal path).
Sourcepub fn resolve<M>(&self, db: &Db<M>, track_id: i64) -> Result<Arc<ResolvedFile>>
pub fn resolve<M>(&self, db: &Db<M>, track_id: i64) -> Result<Arc<ResolvedFile>>
Resolve a track to its layout, caching on a content-version miss. Validation
(stat) and synthesis run outside the cache; quick_cache’s internal locks
are only touched by the brief get and insert.
Sourcepub fn entry_count(&self) -> u64
pub fn entry_count(&self) -> u64
Current number of cached resolved-file entries.
Sourcepub fn weight_bytes(&self) -> u64
pub fn weight_bytes(&self) -> u64
Current resident inline-byte weight.
Sourcepub fn budget_bytes(&self) -> u64
pub fn budget_bytes(&self) -> u64
Configured resident-byte budget.
Sourcepub fn raw_hits(&self) -> u64
pub fn raw_hits(&self) -> u64
Raw key-hit count (NOT content-version-validated hits — see telemetry docs).
Sourcepub fn raw_misses(&self) -> u64
pub fn raw_misses(&self) -> u64
Raw key-miss count.
Auto Trait Implementations§
impl !RefUnwindSafe for HeaderCache
impl !UnwindSafe for HeaderCache
impl Freeze for HeaderCache
impl Send for HeaderCache
impl Sync for HeaderCache
impl Unpin for HeaderCache
impl UnsafeUnpin for HeaderCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more