diff --git a/src/payload.rs b/src/payload.rs index bc40fe80..8f96bab9 100644 --- a/src/payload.rs +++ b/src/payload.rs @@ -39,6 +39,13 @@ impl From for Payload { } } +impl Payload { + /// Takes current payload and replaces it with `None` value + fn take(&mut self) -> Payload { + std::mem::replace(self, Payload::None) + } +} + impl Stream for Payload where S: Stream,