scsys_core/cont/
error.rs

1/*
2    appellation: error <module>
3    authors: @FL03
4*/
5//! this module defines the various errors encountered by storage containers.
6
7/// a type alias for a [`Result`] equipped to handle the [`StoreError`] type
8#[allow(dead_code)]
9pub(crate) type StoreResult<T> = core::result::Result<T, StoreError>;
10/// the [`StoreError`] type enumerates the possible errors that can occur in the store module.
11#[derive(Clone, Copy, Debug, strum::EnumIs, thiserror::Error)]
12pub enum StoreError {
13    #[error(transparent)]
14    EntryError(#[from] EntryError),
15    /// An error indicating that the key was not found in the key-value store.
16    #[error("Key not found in the key-value store")]
17    KeyNotFound,
18}
19/// the [`EntryError`] type enumerates the possible errors that can occur when accessing
20/// entries in the key-value store.
21#[derive(Clone, Copy, Debug, strum::EnumIs, thiserror::Error)]
22pub enum EntryError {
23    /// An error indicating that the value is not present in the key-value store.
24    #[error("The entry is vacant")]
25    VacantEntry,
26}