Skip to main content

CacheEventFn

Type Alias CacheEventFn 

Source
pub type CacheEventFn = Arc<dyn Fn() + Send + Sync>;
Expand description

Optional per-event observer. on_hit runs after each cache hit, on_miss after each miss — wired by CachedTokenizer::with_observer to push events straight into Prometheus counters without a periodic sampling step.

Aliased Type§

pub struct CacheEventFn { /* private fields */ }