use crate::enums::content_encoding::ContentEncoding;
use crate::enums::http_error::{HttpError, HttpErrorKind};
use futures::future::{BoxFuture, FutureExt};
pub trait CompressionDecoder: Send + Sync {
fn gzip_decode(&self, _compressed: Vec<u8>) -> BoxFuture<'static, Result<Vec<u8>, HttpError>> {
async move { Err(HttpErrorKind::Unimplemented.into()) }.boxed()
}
fn zlib_decode(
&self,
_compressed: Vec<u8>,
_size_hint: Option<usize>,
) -> BoxFuture<'static, Result<Vec<u8>, HttpError>> {
async move { Err(HttpErrorKind::Unimplemented.into()) }.boxed()
}
fn brotli_decode(
&self,
_compressed: Vec<u8>,
) -> BoxFuture<'static, Result<Vec<u8>, HttpError>> {
async move { Err(HttpErrorKind::Unimplemented.into()) }.boxed()
}
fn zstd_decode(&self, _compressed: Vec<u8>) -> BoxFuture<'static, Result<Vec<u8>, HttpError>> {
async move { Err(HttpErrorKind::Unimplemented.into()) }.boxed()
}
fn supported_encodings(&self) -> Vec<ContentEncoding>;
}