segcache 0.2.0

Segment-structured cache storage engine with eager TTL expiration
Documentation
// Copyright 2021 Twitter, Inc.
// Copyright 2023 Pelikan Cache contributors
// Licensed under the MIT and Apache-2.0 licenses

//! Top-level errors that will be returned to a caller of this library.

use thiserror::Error;

#[derive(Error, Debug, PartialEq, Eq, Copy, Clone)]
/// Possible errors returned by the top-level API
pub enum SegcacheError {
    #[error("hashtable insert exception")]
    HashTableInsertEx,
    #[error("eviction exception")]
    EvictionEx,
    #[error("item oversized ({size:?} bytes)")]
    ItemOversized { size: usize },
    #[error("no free segments")]
    NoFreeSegments,
    #[error("item exists")]
    Exists,
    #[error("item not found")]
    NotFound,
    #[error("data corruption detected")]
    DataCorrupted,
    #[error("item is not numeric")]
    NotNumeric,
}