Generic error for body stream

This commit is contained in:
Dominik Werder
2024-11-04 11:05:01 +01:00
parent 3b31c244ee
commit 66538ced79
6 changed files with 27 additions and 16 deletions

View File

@@ -188,9 +188,11 @@ pub enum AsyncChannelError {
Recv,
}
pub struct BodyStream {
//pub receiver: async_channel::Receiver<Result<Bytes, Error>>,
pub inner: Box<dyn Stream<Item = Result<Bytes, Error>> + Send + Unpin>,
pub struct BodyStream<E>
where
E: std::error::Error,
{
pub inner: Box<dyn Stream<Item = Result<Bytes, E>> + Send + Unpin>,
}
#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, Ord, Serialize, Deserialize)]