1use std::{
2 error::Error,
3 fmt::{Debug, Display},
4};
5
6#[derive(Debug)]
8pub enum EtagCacheServiceError<CacheGetError, InnerError, CachePutError> {
9 CacheGetError(CacheGetError),
10 InnerError(InnerError),
11 CachePutError(CachePutError),
12 ResponseError(http::Error),
13}
14
15impl<CacheGetError: Display, InnerError: Display, CachePutError: Display> Display
16 for EtagCacheServiceError<CacheGetError, InnerError, CachePutError>
17{
18 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19 match self {
20 Self::CacheGetError(e) => e.fmt(f),
21 Self::InnerError(e) => e.fmt(f),
22 Self::CachePutError(e) => e.fmt(f),
23 Self::ResponseError(e) => std::fmt::Display::fmt(&e, f),
24 }
25 }
26}
27
28impl<
29 CacheGetError: Display + Debug,
30 InnerError: Display + Debug,
31 CachePutError: Display + Debug,
32 > Error for EtagCacheServiceError<CacheGetError, InnerError, CachePutError>
33{
34}