#[non_exhaustive]pub enum CacheError {
InvalidKey(String),
#[non_exhaustive] TypeMismatch {
expected: &'static str,
},
#[non_exhaustive] InvalidSettings {
field: &'static str,
reason: String,
},
}Expand description
Errors every store can return.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidKey(String)
A store name or prefix is empty or has an empty level, or the key given to
CacheKey::new is empty or contains :.
#[non_exhaustive]TypeMismatch
The memory store has a value of another Rust type under the key, such as get::<User> on
a key that set filled with an Order. The Redis store reports JSON that doesn’t fit the
type as its own JSON error instead.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]InvalidSettings
A setting or a write’s ttl is out of range, such as a TTL over
MAX_TTL_SECS or a refresh_threshold of 80.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
Trait Implementations§
Source§impl Debug for CacheError
impl Debug for CacheError
Source§impl Display for CacheError
impl Display for CacheError
Source§impl Error for CacheError
impl Error for CacheError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<CacheError> for RedisCacheError
impl From<CacheError> for RedisCacheError
Source§fn from(source: CacheError) -> RedisCacheError
fn from(source: CacheError) -> RedisCacheError
Converts to this type from the input type.
Source§impl From<CacheError> for HybridCacheError
impl From<CacheError> for HybridCacheError
Source§fn from(source: CacheError) -> HybridCacheError
fn from(source: CacheError) -> HybridCacheError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CacheError
impl RefUnwindSafe for CacheError
impl Send for CacheError
impl Sync for CacheError
impl Unpin for CacheError
impl UnsafeUnpin for CacheError
impl UnwindSafe for CacheError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more