congee 0.2.18

A Rust implementation of ART-OLC concurrent adaptive radix tree.
Documentation
use std::error::Error;
use std::fmt::{self, Debug, Display, Formatter};

#[derive(Debug)]
pub(crate) enum ArtError {
    VersionNotMatch(usize),
    Locked(usize),
    Oom,
}

/// Out of memory error
pub struct OOMError {}

impl OOMError {
    pub(crate) fn new() -> Self {
        Self {}
    }
}

impl Debug for OOMError {
    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
        f.debug_struct("Allocator is out of memory!").finish()
    }
}

impl Display for OOMError {
    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
        write!(f, "Allocator is out of memory!")
    }
}

impl Error for OOMError {}