mirror of
https://github.com/actix/actix-web.git
synced 2025-01-06 15:28:54 +00:00
add Payload::take method
This commit is contained in:
parent
00ea195601
commit
2d0495093c
1 changed files with 7 additions and 0 deletions
|
@ -39,6 +39,13 @@ impl From<PayloadStream> for Payload {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<S> Payload<S> {
|
||||||
|
/// Takes current payload and replaces it with `None` value
|
||||||
|
fn take(&mut self) -> Payload<S> {
|
||||||
|
std::mem::replace(self, Payload::None)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<S> Stream for Payload<S>
|
impl<S> Stream for Payload<S>
|
||||||
where
|
where
|
||||||
S: Stream<Item = Bytes, Error = PayloadError>,
|
S: Stream<Item = Bytes, Error = PayloadError>,
|
||||||
|
|
Loading…
Reference in a new issue