mirror of
https://github.com/fafhrd91/actix-web
synced 2025-08-31 08:57:00 +02:00
remove unpin from body types (#2152)
This commit is contained in:
@@ -52,6 +52,19 @@ impl<T: MessageBody + Unpin> MessageBody for Box<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: MessageBody> MessageBody for Pin<Box<T>> {
|
||||
fn size(&self) -> BodySize {
|
||||
self.as_ref().size()
|
||||
}
|
||||
|
||||
fn poll_next(
|
||||
mut self: Pin<&mut Self>,
|
||||
cx: &mut Context<'_>,
|
||||
) -> Poll<Option<Result<Bytes, Error>>> {
|
||||
self.as_mut().poll_next(cx)
|
||||
}
|
||||
}
|
||||
|
||||
impl MessageBody for Bytes {
|
||||
fn size(&self) -> BodySize {
|
||||
BodySize::Sized(self.len() as u64)
|
||||
|
Reference in New Issue
Block a user