moka/common/
error.rs

1/// The error type for the functionalities around
2/// [`Cache::invalidate_entries_if`][invalidate-if] method.
3///
4/// [invalidate-if]: ./sync/struct.Cache.html#method.invalidate_entries_if
5#[derive(thiserror::Error, Debug)]
6pub enum PredicateError {
7    /// This cache does not have a necessary configuration enabled to support
8    /// invalidating entries with a closure.
9    ///
10    /// To enable the configuration, call
11    /// [`CacheBuilder::support_invalidation_closures`][support-invalidation-closures]
12    /// method at the cache creation time.
13    ///
14    /// [support-invalidation-closures]: ./sync/struct.CacheBuilder.html#method.support_invalidation_closures
15    #[error(
16        "Support for invalidation closures is disabled in this cache. \
17    Please enable it by calling the support_invalidation_closures method \
18    of the builder at the cache creation time"
19    )]
20    InvalidationClosuresDisabled,
21}