{
+ fn is_expired(&self, ttl: Duration) -> bool {
+ self.inserted_at.elapsed() > ttl
+ }
+}
+
+/// Wraps a [`ConfigProvider`] with in-memory TTL-based caching.
+///
+/// Thread-safe via `RwLock`. Cache entries are evicted lazily on access.
+#[derive(Clone)]
+pub struct CachedProvider {
+ inner: P,
+ cache: Arc,
+ ttl: Duration,
+}
+
+struct CacheState {
+ buckets_list: RwLock