#[non_exhaustive]pub enum Error {
Factory {
message: String,
},
FactoryTimeout {
elapsed: Duration,
},
LockTimeout {
elapsed: Duration,
},
Serialization(String),
Deserialization(String),
Distributed(String),
Backplane(String),
}Expand description
An error surfaced from a cache operation.
Note what is deliberately absent: a “cache miss” is not an error (it is a
None/MaybeValue::none), and a factory that fails while fail-safe rescues
a stale value never produces an Error at all.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Factory
The factory failed and no stale value or fail-safe default was available to fall back to. Carries the message reported by the factory.
FactoryTimeout
The factory exceeded its hard timeout and no fallback value existed.
LockTimeout
Acquiring the per-key single-flight lock exceeded its timeout and no fallback value existed.
Serialization(String)
A value could not be serialized for the distributed (L2) cache.
Deserialization(String)
A value could not be deserialized from the distributed (L2) cache.
Distributed(String)
The distributed (L2) cache backend returned an error.
Backplane(String)
The backplane backend returned an error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()