MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / take

Function take

src/ore/src/pager.rs:243–248  ·  view source on GitHub ↗

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>)

Source from the content-addressed store, hash-verified

241///
242/// Panics on I/O failure. Use [`try_take`] to surface the error.
243pub 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.

Callers 15

runFunction · 0.85
split_optionsFunction · 0.85
copy_rowsMethod · 0.85
copy_from_innerMethod · 0.85
flatten_associativeMethod · 0.85
evalMethod · 0.85
build_subpatternsFunction · 0.85
reduce_call_variadicFunction · 0.85
to_proto_lowerMethod · 0.85

Calls 2

take_swapFunction · 0.85
take_fileFunction · 0.85

Tested by 5

round_trip_swapFunction · 0.68
round_trip_fileFunction · 0.68
scatter_round_tripFunction · 0.68