Module content_aware_cache

Module content_aware_cache 

Source
Expand description

Content-aware cache sizing with intelligent memory management.

This module provides adaptive cache sizing based on content characteristics, access patterns, and system resource availability.

§Example

use chie_core::content_aware_cache::{ContentAwareCache, CacheContentMetrics, ContentType};

let mut cache = ContentAwareCache::new(100 * 1024 * 1024); // 100MB

// Add content with metrics
let metrics = CacheContentMetrics {
    content_type: ContentType::VideoChunk,
    size_bytes: 256 * 1024,
    access_frequency: 10,
    priority: 5,
};

cache.insert("video:chunk1".to_string(), vec![0u8; 256 * 1024], metrics);

// Cache automatically adjusts size based on content characteristics
println!("Current cache size: {} bytes", cache.current_size());

Structs§

CacheContentMetrics
Metrics for content-aware caching decisions.
ContentAwareCache
Content-aware cache with intelligent sizing.
ContentCacheStats
Cache statistics.

Enums§

ContentType
Content type classification for cache sizing.