pub enum CacheError {
Show 14 variants
Io(Error),
Serialization(Error),
CapacityExceeded {
current: usize,
max: usize,
},
InvalidConfig(String),
EntryNotFound {
key: String,
},
EntryExpired {
key: String,
},
Timeout {
timeout_ms: u64,
},
Corruption {
details: String,
},
InsufficientMemory {
requested: u64,
available: u64,
},
LockContention {
attempts: u32,
},
PreheatingError(String),
TuningError(String),
CacheLevelError {
level: String,
message: String,
},
Generic(String),
}Expand description
Cache-specific error types
Variants§
Io(Error)
I/O error during cache operations
Serialization(Error)
Serialization/deserialization error
CapacityExceeded
Cache capacity exceeded
InvalidConfig(String)
Invalid cache configuration
EntryNotFound
Cache entry not found
EntryExpired
Cache entry expired
Timeout
Cache operation timeout
Corruption
Cache corruption detected
InsufficientMemory
Insufficient memory for cache operation
LockContention
Cache lock contention
PreheatingError(String)
Predictive preheating error
TuningError(String)
Adaptive tuning error
CacheLevelError
Cache level error (L1, L2, etc.)
Generic(String)
Generic cache error
Implementations§
Source§impl CacheError
impl CacheError
Sourcepub fn capacity_exceeded(current: usize, max: usize) -> Self
pub fn capacity_exceeded(current: usize, max: usize) -> Self
Create a new capacity exceeded error
Sourcepub fn invalid_config<S: Into<String>>(message: S) -> Self
pub fn invalid_config<S: Into<String>>(message: S) -> Self
Create a new invalid config error
Sourcepub fn entry_not_found<S: Into<String>>(key: S) -> Self
pub fn entry_not_found<S: Into<String>>(key: S) -> Self
Create a new entry not found error
Sourcepub fn entry_expired<S: Into<String>>(key: S) -> Self
pub fn entry_expired<S: Into<String>>(key: S) -> Self
Create a new entry expired error
Sourcepub fn corruption<S: Into<String>>(details: S) -> Self
pub fn corruption<S: Into<String>>(details: S) -> Self
Create a new corruption error
Sourcepub fn insufficient_memory(requested: u64, available: u64) -> Self
pub fn insufficient_memory(requested: u64, available: u64) -> Self
Create a new insufficient memory error
Sourcepub fn lock_contention(attempts: u32) -> Self
pub fn lock_contention(attempts: u32) -> Self
Create a new lock contention error
Sourcepub fn preheating_error<S: Into<String>>(message: S) -> Self
pub fn preheating_error<S: Into<String>>(message: S) -> Self
Create a new preheating error
Sourcepub fn tuning_error<S: Into<String>>(message: S) -> Self
pub fn tuning_error<S: Into<String>>(message: S) -> Self
Create a new tuning error
Sourcepub fn cache_level_error<S: Into<String>>(level: S, message: S) -> Self
pub fn cache_level_error<S: Into<String>>(level: S, message: S) -> Self
Create a new cache level error
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if the error is recoverable
Sourcepub fn severity(&self) -> ErrorSeverity
pub fn severity(&self) -> ErrorSeverity
Get error severity level