pub trait RuntimeCacheControl: Default {
// Required methods
fn clear(&mut self);
fn stats(&self) -> CacheStats;
}Expand description
Control surface required for backend runtime caches owned by higher-level runtimes.
Backend caches use this trait so higher-level runtimes and executors can clear and inspect the cache without knowing backend-specific entry types.
§Examples
use tenferro_tensor::{CacheStats, RuntimeCacheControl};
let mut cache = ();
assert_eq!(cache.stats(), CacheStats::empty());
cache.clear();
assert_eq!(cache.stats().entries, 0);Required Methods§
Sourcefn stats(&self) -> CacheStats
fn stats(&self) -> CacheStats
Snapshot retained entries and retained bytes.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".