fix: clear Clone error for #[cached] return types, async_core docsrs badges, doc and spec corrections - #296
Merged
Merged
Conversation
…ocsrs badges, doc and spec corrections - `#[cached]` on a non-`Clone` return type now emits a `Clone`-bound error spanned at the return type (a compile-time assertion on the cached value type, including `Return<T>` under `with_cached_flag`), ahead of the opaque errors from the generated internals. Trybuild tests cover the plain and `with_cached_flag` negative cases plus a generic-function positive case. - add the missing `doc(cfg(feature = "async_core"))` badges on the `CachedGetOrSetAsync` / `ConcurrentCachedAsync` impls for the in-memory and sharded stores and `HashMap`, so docs.rs marks them feature-gated. - correct the changelog and `specs/store-lru.md` claim that `UnboundCache` has no `retain` (it shipped in #294); document the `UnboundCache` semantics (predicate filter, fires `on_evict`, no eviction counter). - migration guides: fix the `cache_peek_with_expiry_status` sibling name, reword the rc-era no-arg builder note, and add human-guide sections for `CacheTtl`/`CacheEvict` removal from concurrent stores and the redis empty-prefix `InvalidValue` rejection. - specs: add LRU-5/TTL-5/EXPIRE-6 covering `iter_order`/`value_order`/`CacheValue`; mark design 0020 Declined in the index. - document the lookup-key difference between the trait families (`&Q where K: Borrow<Q>` on `Cached` vs `&K` on `ConcurrentCached`) in the lib.rs comparison docs; README regenerated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clone-bound compile error spanned at the return type when a#[cached]function's return type is notClone, ahead of the opaque errors from the generated internals. The assertion targets the cached value type (innerTofResult/Option,Return<T>underwith_cached_flag). Trybuild tests cover the plain andwith_cached_flagnegative cases plus a generic-function positive case.doc(cfg(feature = "async_core"))badges on theCachedGetOrSetAsync/ConcurrentCachedAsyncimpls for the in-memory and sharded stores andHashMap.specs/store-lru.mdclaim thatUnboundCachehas noretain(it shipped in feat: shardedpeek, buildernew(), ext alias parity, concurrentcache_try_get_or_set_with,retainon map stores #294); document its semantics (predicate filter, fireson_evict, no eviction counter).cache_peek_with_expiry_statussibling name, reword the rc-era no-arg builder note, add human-guide sections forCacheTtl/CacheEvictremoval from concurrent stores and the redis empty-prefixInvalidValuerejection.iter_order/value_order/CacheValue; mark design 0020 Declined in the index.&Q where K: Borrow<Q>onCachedvs&KonConcurrentCached); README regenerated.