MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / new

Method new

graphlite/src/cache/plan_cache.rs:121–130  ·  view source on GitHub ↗
(max_entries: usize, max_memory_bytes: usize, default_ttl: Duration)

Source from the content-addressed store, hash-verified

119
120impl PlanCache {
121 pub fn new(max_entries: usize, max_memory_bytes: usize, default_ttl: Duration) -> Self {
122 Self {
123 entries: Arc::new(RwLock::new(HashMap::new())),
124 max_entries,
125 max_memory_bytes,
126 current_memory: Arc::new(RwLock::new(0)),
127 stats: Arc::new(RwLock::new(PlanCacheStats::default())),
128 default_ttl,
129 }
130 }
131
132 /// Get cached plan if available
133 pub fn get(&self, key: &PlanCacheKey) -> Option<PlanCacheEntry> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected