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

Method new

graphlite/src/cache/subquery_cache.rs:380–391  ·  view source on GitHub ↗
(max_entries: usize, max_memory_bytes: usize, default_ttl: Duration)

Source from the content-addressed store, hash-verified

378
379impl SubqueryCache {
380 pub fn new(max_entries: usize, max_memory_bytes: usize, default_ttl: Duration) -> Self {
381 Self {
382 entries: Arc::new(RwLock::new(HashMap::new())),
383 max_entries,
384 max_memory_bytes,
385 current_memory: Arc::new(RwLock::new(0)),
386 stats: Arc::new(RwLock::new(SubqueryCacheStats::default())),
387 default_ttl,
388 boolean_index: Arc::new(RwLock::new(HashMap::new())),
389 scalar_index: Arc::new(RwLock::new(HashMap::new())),
390 }
391 }
392
393 /// Get cached subquery result
394 pub fn get(&self, key: &SubqueryCacheKey) -> Option<SubqueryResult> {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected