aether/api/cache.rs
1use super::Aether;
2use crate::cache::CacheStats;
3
4impl Aether {
5 /// 获取缓存统计信息
6 pub fn cache_stats(&self) -> CacheStats {
7 self.cache.stats()
8 }
9
10 /// 清空缓存
11 pub fn clear_cache(&mut self) {
12 self.cache.clear();
13 }
14
15 /// 设置优化选项
16 pub fn set_optimization(
17 &mut self,
18 constant_folding: bool,
19 dead_code: bool,
20 tail_recursion: bool,
21 ) {
22 self.optimizer.constant_folding = constant_folding;
23 self.optimizer.dead_code_elimination = dead_code;
24 self.optimizer.tail_recursion = tail_recursion;
25 }
26}