with_global_cache

Function with_global_cache 

Source
pub fn with_global_cache<F, R>(closure: F) -> R
where F: FnOnce(&GlobalSampleCache) -> R,
Expand description

Executes a closure with a reference to the global sample cache. This pattern is used to safely access thread-local storage without returning a reference that could outlive the scope of the thread-local data.