mmap_cache/
error.rs

1use std::io;
2
3#[derive(Debug)]
4pub enum Error {
5    Fst(fst::Error),
6    IO(io::Error),
7}
8
9impl std::fmt::Display for Error {
10    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
11        match self {
12            Self::Fst(e) => e.fmt(f),
13            Self::IO(e) => e.fmt(f),
14        }
15    }
16}
17impl std::error::Error for Error {}
18
19impl From<fst::Error> for Error {
20    fn from(e: fst::Error) -> Self {
21        Self::Fst(e)
22    }
23}
24
25impl From<io::Error> for Error {
26    fn from(e: io::Error) -> Self {
27        Self::IO(e)
28    }
29}