use thiserror::Error;
#[derive(Error, Debug)]
pub enum CacheError {
#[error("Io error: {0}")]
Io(#[from] std::io::Error),
#[error("Cache is missing.")]
Missing,
#[error("Lock poisoned")]
Poisoned,
#[error("The CacheLine chosen to evict is in using. Consider dropping refs you get, trying again or increasing the capacity of the cache.")]
Busy,
#[error("The CacheLine is locked.")]
Locked,
}
pub type CacheResult<T> = std::result::Result<T, CacheError>;