MCPcopy Create free account
hub / github.com/cosdata/cosdata / serialize

Method serialize

src/models/tree_map.rs:555–567  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

553
554impl<K, V: SimpleSerialize> TreeMap<K, V> {
555 pub fn serialize(&self) -> Result<(), BufIoError> {
556 let cursor = self.dim_bufman.open_cursor()?;
557 self.dim_bufman.update_u32_with_cursor(cursor, u32::MAX)?;
558 let offset = self
559 .root
560 .serialize(&self.dim_bufman, &self.data_bufmans, cursor)?;
561 self.dim_bufman.seek_with_cursor(cursor, 0)?;
562 self.dim_bufman.update_u32_with_cursor(cursor, offset)?;
563 self.dim_bufman.close_cursor(cursor)?;
564 self.dim_bufman.flush()?;
565 self.data_bufmans.flush_all()?;
566 Ok(())
567 }
568
569 pub fn deserialize(
570 dim_bufman: BufferManager,

Callers 6

flushMethod · 0.45
flushMethod · 0.45
flushMethod · 0.45
flushMethod · 0.45
write_lazy_item_to_fileFunction · 0.45

Calls 6

open_cursorMethod · 0.80
seek_with_cursorMethod · 0.80
close_cursorMethod · 0.80
flushMethod · 0.45
flush_allMethod · 0.45

Tested by

no test coverage detected