pub enum CacheError {
CreateShard(PathBuf, Error),
Serialize(String, Error),
Write(PathBuf, Error),
Walk(Error),
Stat(PathBuf, Error),
Remove(PathBuf, Error),
}Expand description
What can go wrong at write time.
Reads are infallible by design: a corrupt or missing entry is a miss, not
an error, so get returns Option<Value>. The caller treats write
failures as non-fatal (log and continue); only the path to disk, the
serialisation, the directory creation, and eviction need error variants.
Variants§
CreateShard(PathBuf, Error)
The shard directory could not be created on put.
Serialize(String, Error)
Serialising the value to JSON failed. Should be unreachable for
values produced by serde_json itself, but the type permits any
Value, so the error path exists.
Write(PathBuf, Error)
Writing the JSON file failed (disk full, permissions, race with concurrent eviction).
Walk(Error)
Reading the cache directory during eviction failed.
Stat(PathBuf, Error)
Stat-ing an entry during eviction failed.
Remove(PathBuf, Error)
Removing an entry during eviction failed.
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()