MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / serialize_columns_unchecked

Method serialize_columns_unchecked

crates/table/src/table.rs:1815–1823  ·  view source on GitHub ↗

Serializes the `cols` of `self` using `ser`. # Safety Any `col` in `cols` is in-bounds of `self`'s layout.

(self, cols: &ColList, ser: S)

Source from the content-addressed store, hash-verified

1813 ///
1814 /// Any `col` in `cols` is in-bounds of `self`'s layout.
1815 pub unsafe fn serialize_columns_unchecked<S: Serializer>(self, cols: &ColList, ser: S) -> Result<S::Ok, S::Error> {
1816 let table = self.table;
1817 let (page, offset) = table.page_and_offset(self.pointer);
1818 // SAFETY:
1819 // - We have a `RowRef`, so `ptr` points to a valid row in this table
1820 // so safety requirements 1-3 flow from that.
1821 // - Caller promised that any `col` in `cols` is in-bounds of `self`'s layout.
1822 unsafe { serialize_columns_from_page(ser, page, self.blob_store, offset, &table.row_layout, cols) }
1823 }
1824
1825 /// Construct a projection of the row at `self` by extracting the `cols`.
1826 ///

Callers 1

from_row_refMethod · 0.80

Calls 2

page_and_offsetMethod · 0.80

Tested by

no test coverage detected