PackageTrack
Sign in Get early access

cached

Generic cache implementations and simplified function memoization

2.0.2 42M downloads/mo #1385 most downloaded on crates.io jaemk/cached

What this package is like to depend on

Last release 19 days ago

04 Aug 2026

Ships unpredictably

gaps range from 8 days to 8 months

No release notes found

nothing matched a version

1 version withdrawn

withdrawn after publishing

9 years old

107 releases · first in 2017

18 releases in the last 12 months

see the full history below

Release timeline

107 releases · Mar 2017 to Aug 2026
2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 60 of 107
  1. 3.0.0-rc.10 04 Aug 2026 pre-release
    Release notes

    What's Changed

    • feat: bound trait Error types, add cache_contains, peek/reset aliases by @jaemk in #290
    • feat: require unbounded cache_contains, peek-based contains parity, remove inherent TtlSortedCache::set_ttl by @jaemk in #291
    • release: 3.0.0-rc.9 by @jaemk in #292
    • feat: remove CacheSetError, rename TtlSortedCache insert* to set*, wrap order-method values in CacheValue by @jaemk in #293
    • feat: sharded peek, builder new(), ext alias parity, concurrent cache_try_get_or_set_with, retain on map stores by @jaemk in #294
    • docs: fix cache_contains implementor listing and docsrs gate, note Arc<T> return pattern, add peek recency test by @jaemk in #295
    • fix: clear Clone error for #[cached] return types, async_core docsrs badges, doc and spec corrections by @jaemk in #296
    • feat: TtlSortedCache::set_with builder, ConcurrentCachePeek, ConcurrentCachedExt::try_get_or_set_with by @jaemk in #297
    • feat: retain on TtlSortedCache and the six sharded stores by @jaemk in #298
    • perf: in-memory and sharded store speedups; promote on cache_set overwrite by @jaemk in #299
    • feat: derive default shard count from max_size, make cache_contains dyn-callable by @jaemk in #300
    • feat: count evictions before on_evict, clear Clone error for #[once], no-callback retain fast path by @jaemk in #301
    • 3.0.0-rc.10: retain returns removed count, ConcurrentCachePeekAsync, MSRV 1.92 by @jaemk in #302

    Full Changelog: cached_proc_macro_types-v3.0.0-rc.8...v3.0.0-rc.10

    Open source →
  2. 3.0.0-rc.9 20 Jul 2026 pre-release
    Release notes

    Breaking Changes

    • Cached::Error and ConcurrentCacheBase::Error are now bounded by
      std::error::Error + Send + Sync + 'static. Custom store implementations whose error
      type does not implement std::error::Error (or is not Send/Sync/'static) must update
      their type Error. All built-in stores (Infallible, CacheSetError, RedisCacheError,
      RedbCacheError) already satisfy the bound. See the migration guide for detection and remediation.
    • ConcurrentCached::cache_contains and ConcurrentCachedAsync::async_cache_contains are now
      required methods, no longer defaulted, and no longer carry a V: Clone (async: V: Clone + Send)
      bound. External implementors of ConcurrentCached / ConcurrentCachedAsync must add these
      methods; the previous defaulted version only ever shipped in 3.0.0 rcs. Rationale: the V: Clone
      bound blocked contains for non-Clone value types and could not be relaxed after 3.0.0 without
      another breaking change. ConcurrentCachedExt::contains also drops its V: Clone bound.
    • TtlSortedCache::set_ttl inherent method removed. Runtime TTL controls are now only on the
      traits: CacheTtl for single-owner stores, ConcurrentCacheTtl for concurrent stores. Migration:
      use cached::CacheTtl; and the same cache.set_ttl(d) call compiles with identical semantics.
    • CachedExt::contains now delegates to Cached::cache_contains (new, defaulted; built-ins
      override with a peek-based implementation) instead of cache_get. As a result contains no
      longer counts a hit/miss, promotes LRU recency, or refreshes TTL on refresh-on-hit stores, and
      reports expired entries as absent. This only affects the rc surface; the trait-level default of
      Cached::cache_contains remains get-based for third-party stores that do not override it.

    Added

    • CachedPeek::peek: ergonomic alias for cache_peek.
    • CloneCached::peek_with_expiry_status: ergonomic alias for cache_peek_with_expiry_status.
    • ConcurrentCloneCached::peek_with_expiry_status: ergonomic alias for
      cache_peek_with_expiry_status on the concurrent clone trait.
    • CachedExt::reset: ergonomic alias for Cached::cache_reset, mirroring the existing
      ConcurrentCachedExt::reset.
    • Cached::cache_contains<Q>(&mut self, k: &Q) -> bool: defaulted presence check on the core
      single-owner trait (default get-based; built-in stores override with a peek-based implementation).
      CachedExt::contains delegates to it, giving contains both spellings on both trait families.
    • ConcurrentCached::cache_contains: required presence check returning Result<bool, Self::Error>,
      no V: Clone bound. The built-in sharded stores use a peek-based implementation (read lock, no
      clone, no recency update, no hit/miss metrics); RedisCache / RedbCache
      use a get-based implementation. External implementors of ConcurrentCached must add this method.
    • ConcurrentCachedAsync::async_cache_contains: required async counterpart of cache_contains,
      no V: Clone + Send bound; same impl split as the sync method. External implementors of
      ConcurrentCachedAsync must add this method.
    • ConcurrentCachedExt::contains: ergonomic alias for cache_contains, no V: Clone bound.
    • Inherent contains(&self, &K) -> bool on all six sharded stores: peek-based, infallible,
      takes call-site priority over ConcurrentCachedExt::contains (consistent with the other
      inherent shims like get/set/reset).
    • ExpiringLruCache::iter_order / key_order / value_order: recency-order introspection
      matching LruCache (plain (K, V) / K / V shapes; expired entries excluded), completing
      the LRU-family parity started with retain.
    • #[must_use] on ConcurrentCached::cache_remove and cache_remove_entry, their
      ConcurrentCachedAsync counterparts async_cache_remove / async_cache_remove_entry, and the
      ConcurrentCachedExt aliases remove / remove_entry.
    • #[must_use] on RedbCacheError::is_deserialization, matching RedisCacheError::is_deserialization.
    • #[cfg_attr(docsrs, doc(cfg(feature = "time_stores")))] on the ShardedTtlCache* and
      ShardedLruTtlCache* re-exports in src/stores/sharded/mod.rs.

    Changed

    • encode_ttl/decode_ttl deduplicated from src/stores/sharded/ttl.rs and
      src/stores/sharded/lru_ttl.rs into a single pub(crate) copy in
      src/stores/sharded/mod.rs; both files now import from there. No behavior change.

    Documentation

    • Prelude doc corrected: it re-exports both traits and the CacheMetrics struct, not traits only.
    • The compile_fail snippet for cache_get_or_set_with includes a leading comment making its
      non-compiling intent clear in the generated README (where compile_fail renders as plain Rust).
    • docs/migrations/2.0-to-3.0-human.md: added section on Return<T> field privatization
      (r.value / r.was_cached -> deref / into_inner() / was_cached()).
    • docs/migrations/2.0-to-3.0.md and 2.0-to-3.0-human.md: added the Cached::Error and
      ConcurrentCacheBase::Error bound as a breaking change entry.
    • specs/traits-core.md and specs/traits-concurrent.md: updated to record Error bounds,
      peek aliases, reset, cache_contains/async_cache_contains/contains.
    • docs/migrations/2.0-to-3.0.md and 2.0-to-3.0-human.md: added entries for required
      cache_contains/async_cache_contains, TtlSortedCache::set_ttl inherent removal, and the
      single-owner contains semantic change.
    • specs/traits-core.md: added Cached::cache_contains defaulted method and updated
      CachedExt::contains delegation.
    • specs/traits-concurrent.md: updated cache_contains/async_cache_contains to required,
      unbounded; updated ext alias and IO store impls.
    • specs/store-sharded.md: added inherent contains to the sharded store inherent-shim list.
    Open source →
  3. 3.0.0-rc.8 17 Jul 2026 pre-release
    Release notes

    What's Changed

    • docs: show expires = true with Result and Option returns in expires_per_key example by @jaemk in #269
    • chore: update hashbrown to 0.17, criterion to 0.8, googletest to 0.14 by @jaemk in #270
    • redb DiskCache backend and API cleanups (staged for next major) by @jaemk in #271
    • feat: macros, stores/traits, redis TLS split, runtime decoupling, constructor and ttl consistency by @jaemk in #272
    • release: 3.0.0-rc.1 by @jaemk in #273
    • v3 API changes, security hardening, and macro guards by @jaemk in #274
    • 3.0 pre-release fixes: sync_writes revert, redis feature axes, CachedGetOrSetAsync by @jaemk in #276
    • 3.0.0-rc.3: freeze the v3 API, behavior and docs fixes, test/CI hardening by @jaemk in #277
    • 3.0.0-rc.4: rc.3 review fixes (behavior, packaging, docs) by @jaemk in #278
    • 3.0.0-rc.5: v3 review fixes (behavior, breaking API, docs, specs) by @jaemk in #279
    • restructure specs into a feature inventory by @jaemk in #280
    • 3.0.0-rc.6: pre-release review fixes (behavior, api, docs) by @jaemk in #281
    • test: widen the async redb eviction race ttl to match the sync test by @jaemk in #282
    • 3.0.0-rc.7: pre-release review fixes (redis prefix guard, redb dir self-heal, docs, example CI) by @jaemk in #283
    • reject inert sync_writes_buckets, drop expiring-store struct bounds, derive ConnectionString eq, store format and doc fixes by @jaemk in #284
    • feat: add runtime set_max_size to sharded LRU stores, rename RedbCacheBuilder::disk_dir, add resilience example by @jaemk in #285
    • Trait-only sharded ttl controls, per-shard initial capacity, ExpiringLruCache::retain, docs and spec fixes by @jaemk in #286
    • rename SetMaxSizeError::ZeroSize to ZeroMaxSize, document redis/redb format stability, correct spec drift by @jaemk in #287
    • fix: Acquire load for sharded metrics().capacity, document concurrent set_max_size semantics, sync specs by @jaemk in #288
    • release: 3.0.0-rc.8 by @jaemk in #289

    Full Changelog: v2.0.2...v3.0.0-rc.8

    Open source →
  4. 3.0.0-rc.7 12 Jul 2026 pre-release

    Nothing published for this version

  5. 3.0.0-rc.6 11 Jul 2026 pre-release

    Nothing published for this version

  6. 3.0.0-rc.5 07 Jul 2026 pre-release

    Nothing published for this version

  7. 3.0.0-rc.4 06 Jul 2026 pre-release

    Nothing published for this version

  8. 3.0.0-rc.3 05 Jul 2026 pre-release

    Nothing published for this version

  9. 3.0.0-rc.2 02 Jul 2026 pre-release

    Nothing published for this version

  10. 3.0.0-rc.1 21 Jun 2026 pre-release

    Nothing published for this version

  11. 2.0.2 07 Jun 2026

    Nothing published for this version

  12. 2.0.1 06 Jun 2026

    Nothing published for this version

  13. 2.0.0 06 Jun 2026

    Nothing published for this version

  14. 1.1.0 25 May 2026

    Nothing published for this version

  15. 1.0.0 21 May 2026

    Nothing published for this version

  16. 0.59.0 22 Mar 2026

    Nothing published for this version

  17. 0.58.0 09 Mar 2026

    Nothing published for this version

  18. 0.57.0 09 Mar 2026

    Nothing published for this version

  19. 0.56.0 22 Jul 2025

    Nothing published for this version

  20. 0.55.1 03 Mar 2025

    Nothing published for this version

  21. 0.55.0 03 Mar 2025 withdrawn

    Nothing published for this version

  22. 0.54.0 06 Nov 2024

    Nothing published for this version

  23. 0.53.1 23 Jul 2024

    Nothing published for this version

  24. 0.53.0 20 Jul 2024

    Nothing published for this version

  25. 0.52.0 03 Jul 2024

    Nothing published for this version

  26. 0.51.4 13 Jun 2024

    Nothing published for this version

  27. 0.51.3 08 May 2024

    Nothing published for this version

  28. 0.51.2 07 May 2024

    Nothing published for this version

  29. 0.51.1 05 May 2024

    Nothing published for this version

  30. 0.51.0 03 May 2024

    Nothing published for this version

  31. 0.50.0 26 Apr 2024

    Nothing published for this version

  32. 0.49.3 07 Apr 2024

    Nothing published for this version

  33. 0.49.2 24 Feb 2024

    Nothing published for this version

  34. 0.49.1 24 Feb 2024

    Nothing published for this version

  35. 0.49.0 24 Feb 2024

    Nothing published for this version

  36. 0.48.1 22 Jan 2024

    Nothing published for this version

  37. 0.48.0 22 Jan 2024

    Nothing published for this version

  38. 0.47.0 03 Jan 2024

    Nothing published for this version

  39. 0.46.1 06 Nov 2023

    Nothing published for this version

  40. 0.46.0 24 Sep 2023

    Nothing published for this version

  41. 0.45.1 06 Sep 2023

    Nothing published for this version

  42. 0.45.0 05 Sep 2023

    Nothing published for this version

  43. 0.44.0 03 Jun 2023

    Nothing published for this version

  44. 0.43.0 11 Apr 2023

    Nothing published for this version

  45. 0.42.0 04 Jan 2023

    Nothing published for this version

  46. 0.41.0 17 Dec 2022

    Nothing published for this version

  47. 0.40.0 23 Oct 2022

    Nothing published for this version

  48. 0.39.0 02 Sep 2022

    Nothing published for this version

  49. 0.38.0 02 Aug 2022

    Nothing published for this version

  50. 0.37.0 17 Jul 2022

    Nothing published for this version

  51. 0.36.0 04 Jul 2022

    Nothing published for this version

  52. 0.35.0 04 Jul 2022

    Nothing published for this version

  53. 0.34.1 11 Jun 2022

    Nothing published for this version

  54. 0.34.0 10 Mar 2022

    Nothing published for this version

  55. 0.33.0 01 Mar 2022

    Nothing published for this version

  56. 0.32.1 26 Feb 2022

    Nothing published for this version

  57. 0.32.0 26 Feb 2022

    Nothing published for this version

  58. 0.31.0 25 Feb 2022

    Nothing published for this version

  59. 0.30.0 21 Jan 2022

    Nothing published for this version

  60. 0.29.0 12 Jan 2022

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive