mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-28 01:32:57 +01:00
add Payload::take method
This commit is contained in:
parent
00ea195601
commit
2d0495093c
@ -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 New Issue
Block a user