pub struct TagRegistry { /* private fields */ }Expand description
A lazy registry of tag and clear markers, shared across the cache.
Implementations§
Source§impl TagRegistry
impl TagRegistry
Sourcepub fn mark_tag(&self, tag: Tag, at: Timestamp)
pub fn mark_tag(&self, tag: Tag, at: Timestamp)
Records that the given tag was invalidated at at (keeping the latest of
any existing marker).
Sourcepub fn tag_marker(&self, tag: &Tag) -> Option<Timestamp>
pub fn tag_marker(&self, tag: &Tag) -> Option<Timestamp>
Returns the marker timestamp for a tag, if any.
Sourcepub fn mark_clear_expire(&self, at: Timestamp)
pub fn mark_clear_expire(&self, at: Timestamp)
Records a “clear (expire)” at at: every entry created strictly before
this point becomes logically expired.
Sourcepub fn mark_clear_remove(&self, at: Timestamp)
pub fn mark_clear_remove(&self, at: Timestamp)
Records a “clear (remove)” at at: every entry created strictly before
this point is hard-removed.
Sourcepub fn evaluate(
&self,
entry_created: Timestamp,
tags: &[Tag],
behavior: RemoveByTagBehavior,
) -> TagVerdict
pub fn evaluate( &self, entry_created: Timestamp, tags: &[Tag], behavior: RemoveByTagBehavior, ) -> TagVerdict
Evaluates an entry (by its creation timestamp and tags) against all markers, returning the strongest applicable verdict.
Order mirrors FusionCache: clear-remove first (hardest), then per-tag
markers (honouring behavior), then clear-expire. The comparison is
strict (entry_created < marker): an entry created in the same tick as a
marker survives, exactly as in FusionCache (an entry is invalidated only
when the marker is greater than its creation tick).