1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use std::sync::{Arc, Mutex};
use std::fmt::Debug;

#[derive(Debug, Clone)]
pub enum Error<PE>
    where PE: Debug + Clone + Send + Sync + 'static,
{
    CacheError(String),
    ProcessingError(PE),
    OnEmissionError(String),
    IoError(String),
    EncodeError(String),
    DecodeError(String),
}


impl<PE> From<PE> for Error<PE>
    where PE: Debug + Clone + Send + Sync + 'static,
{
    fn from(err: PE) -> Self {
        Self::ProcessingError(err)
    }
}