Consumes handle, writing the entire payload into `dst` (cleared first), then reclaims storage. Swap fast path: single-chunk handle into empty `dst` swaps in place, no copy. Panics on I/O failure. Use [`try_take`] to surface the error.
(handle: Handle, dst: &mut Vec<u64>)
| 241 | /// |
| 242 | /// Panics on I/O failure. Use [`try_take`] to surface the error. |
| 243 | pub fn take(handle: Handle, dst: &mut Vec<u64>) { |
| 244 | match &handle.inner { |
| 245 | HandleInner::Swap(_) => swap::take_swap(handle, dst), |
| 246 | HandleInner::File(_) => file::take_file(handle, dst), |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | /// Fallible counterpart to [`take`]. On I/O error the handle is consumed and |
| 251 | /// `dst` may hold partial data; the scratch file is unlinked on inner drop. |