Skip to content

docs: fix cache_contains implementor listing and docsrs gate, note Arc<T> return pattern, add peek recency test - #295

Merged
jaemk merged 5 commits into
masterfrom
260720.pre-3.0-docs-fixes
Jul 24, 2026
Merged

docs: fix cache_contains implementor listing and docsrs gate, note Arc<T> return pattern, add peek recency test#295
jaemk merged 5 commits into
masterfrom
260720.pre-3.0-docs-fixes

Conversation

@jaemk

@jaemk jaemk commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Docs and test fixes ahead of 3.0.0 final. Stacked on #294.

  • Drop AsyncRedisCache from the sync ConcurrentCached::cache_contains docs and the rc.9 changelog entry (it implements async_cache_contains); note the dyn limitation of the where Self: Sized bound.
  • Add the missing doc(cfg(feature = "redis_async_cache")) on AsyncRedisCacheBuilder::client_side_caching.
  • Note in the human migration guide that async_cache_contains is declared in RPIT form and async fn desugars to it.
  • Document the Arc<T> return pattern for expensive-to-clone values in the macro docs (Supporting references #64); regenerate README.
  • Add a test asserting the CachedPeek::peek alias does not promote LRU recency or count hit/miss metrics.
  • Add the missing 2.x breaking changes to the human migration guide: Cached::Error / infallible in-memory set paths, the TtlSortedCache insert* -> set* rename, and the CacheValue-wrapped iter_order / value_order shapes.
  • Note on Cached::cache_try_set that generic code supporting fallible custom stores should call it and propagate Self::Error.

…et*`, wrap order-method values in `CacheValue`

Breaking changes ahead of 3.0.0 final:

- remove `CacheSetError`: a TTL that would overflow `Instant` bounds now
  stores the entry with no expiry (never expires) on every set path,
  matching the sharded TTL stores (`cache_set` already behaved this way).
  `TtlCache` / `LruTtlCache` / `TtlSortedCache` set
  `Cached::Error = Infallible`, so every built-in in-memory store is
  infallible; the `type Error` machinery remains for custom and IO stores.
- rename `TtlSortedCache::insert` / `insert_ttl` / `insert_evict` /
  `insert_ttl_evict` to `set` / `set_with_ttl` / `set_evict` /
  `set_with_ttl_evict`, returning `Option<V>` instead of `Result`.
- unify the LRU-family order methods on one shape:
  `iter_order() -> Vec<(K, CacheValue<V, M>)>` and
  `value_order() -> Vec<CacheValue<V, M>>` on `LruCache`, `LruTtlCache`,
  and `ExpiringLruCache`. `CacheValue<V, M = ()>` (new root re-export)
  derefs to `V`, compares against bare values, and exposes per-entry
  metadata via typed accessors: `expires_at()` on `LruTtlCache` entries
  (`M = Option<Instant>`). `LruTtlCache` no longer leaks bare
  `(Option<Instant>, V)` tuples.

Migration guide sections 18/22/33/43 updated and 74/75 added; design doc
0020 closed out (error split kept, `TimeBounds` gone).
@jaemk
jaemk force-pushed the 260720.pre-3.0-additive-parity branch from b2aa189 to ca91f18 Compare July 21, 2026 01:55
@jaemk
jaemk force-pushed the 260720.pre-3.0-docs-fixes branch 2 times, most recently from b0d66a6 to d6dbba3 Compare July 21, 2026 02:15
jaemk added 2 commits July 21, 2026 08:36
…cache_try_get_or_set_with`, `retain` on map stores
…`Arc<T>` return pattern, add `peek` recency test

- drop `AsyncRedisCache` from the sync `ConcurrentCached::cache_contains`
  docs and the rc.9 changelog entry (it implements `async_cache_contains`);
  note the `dyn` limitation of the `where Self: Sized` bound
- add the missing `doc(cfg(feature = "redis_async_cache"))` on
  `AsyncRedisCacheBuilder::client_side_caching`
- note in the human migration guide that `async_cache_contains` is declared
  in RPIT form and `async fn` desugars to it
- document the `Arc<T>` return pattern for expensive-to-clone values in the
  macro docs (#64); regenerate README
- add a test asserting the `CachedPeek::peek` alias does not promote LRU
  recency or count hit/miss metrics
@jaemk
jaemk force-pushed the 260720.pre-3.0-additive-parity branch from ca91f18 to ffbecc1 Compare July 21, 2026 12:40
@jaemk
jaemk force-pushed the 260720.pre-3.0-docs-fixes branch from d6dbba3 to 002ed17 Compare July 21, 2026 12:40
…note generic use of `cache_try_set`

- Add human-guide sections for `Cached::Error` / infallible in-memory set
  paths, the `TtlSortedCache` `insert*` -> `set*` rename, and the
  `CacheValue`-wrapped `iter_order` / `value_order` shapes; drop the stale
  machine-guide entry range from the section intro.
- Note on `Cached::cache_try_set` that generic code supporting fallible
  custom stores should call it and propagate `Self::Error`.
@jaemk
jaemk changed the base branch from 260720.pre-3.0-additive-parity to master July 24, 2026 00:18
@jaemk
jaemk merged commit 6c28c16 into master Jul 24, 2026
1 check passed
@jaemk
jaemk deleted the 260720.pre-3.0-docs-fixes branch July 24, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant