xz-rag 0.1.1

Multi-channel Retrieval-Augmented Generation engine
Documentation
/// In-memory caching for retrieval results (feature-gated by `caching`).
#[cfg(feature = "caching")]
pub mod memory_cache;

/// No-op cache replacement when the `caching` feature is disabled.
#[cfg(not(feature = "caching"))]
pub mod memory_cache {
    use crate::types::retrieval::RetrieveResult;

    /// No-op cache when caching feature is disabled.
    pub struct NoopCache;

    impl NoopCache {
        /// Create a new no-op cache instance. Parameters are ignored.
        pub fn new(_max_entries: usize, _ttl_seconds: u64) -> Self {
            Self
        }

        /// Always returns `None` — no-op placeholder.
        pub async fn get(&self, _key: &str) -> Option<RetrieveResult> {
            None
        }

        /// No-op — does not store the provided value.
        pub async fn set(&self, _key: &str, _value: RetrieveResult) {}

        /// No-op — does not invalidate anything.
        pub fn invalidate(&self, _namespace: &str) {}
    }
}