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

Method pack

src/repr/src/row.rs:194–202  ·  view source on GitHub ↗

Take some `Datum`s and pack them into a `Row`. This method builds a `Row` by repeatedly increasing the backing allocation. If the contents of the iterator are known ahead of time, consider [`Row::with_capacity`] to right-size the allocation first, and then [`RowPacker::extend`] to populate it with `Datum`s. This avoids the repeated allocation resizing and copying.

(iter: I)

Source from the content-addressed store, hash-verified

192 /// first, and then [`RowPacker::extend`] to populate it with `Datum`s.
193 /// This avoids the repeated allocation resizing and copying.
194 pub fn pack<'a, I, D>(iter: I) -> Row
195 where
196 I: IntoIterator<Item = D>,
197 D: Borrow<Datum<'a>>,
198 {
199 let mut row = Row::default();
200 row.packer().extend(iter);
201 row
202 }
203
204 /// Use `self` to pack `iter`, and then clone the result.
205 ///

Callers 2

_set_lingerMethod · 0.45

Calls 4

packerMethod · 0.80
getFunction · 0.50
extendMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected