mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-22 00:00:11 +02:00
stream: add ChunksTimeout::into_remainder (#7715)
This commit is contained in:
@@ -33,6 +33,12 @@ impl<S: Stream> ChunksTimeout<S> {
|
||||
cap: max_size,
|
||||
}
|
||||
}
|
||||
|
||||
/// Consumes the [`ChunksTimeout`] and then returns all buffered items.
|
||||
pub fn into_remainder(mut self: Pin<&mut Self>) -> Vec<S::Item> {
|
||||
let me = self.as_mut().project();
|
||||
std::mem::take(me.items)
|
||||
}
|
||||
}
|
||||
|
||||
impl<S: Stream> Stream for ChunksTimeout<S> {
|
||||
|
||||
Reference in New Issue
Block a user