MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / table_rows

Function table_rows

atomic-core/tests/merge_test.rs:73–87  ·  view source on GitHub ↗
(db: &Database, definition: TableDefinition<u64, V>)

Source from the content-addressed store, hash-verified

71}
72
73fn table_rows<V>(db: &Database, definition: TableDefinition<u64, V>) -> Vec<(u64, Vec<u8>)>
74where
75 V: for<'a> redb::Value<SelfType<'a> = &'a [u8]> + 'static,
76{
77 let txn = db.begin_read().unwrap();
78 let table = txn.open_table(definition).unwrap();
79 table
80 .iter()
81 .unwrap()
82 .map(|entry| {
83 let (key, value) = entry.unwrap();
84 (key.value(), value.value().to_vec())
85 })
86 .collect()
87}
88
89fn graph_rows(
90 db: &Database,

Callers

nothing calls this directly

Calls 5

begin_readMethod · 0.80
valueMethod · 0.80
unwrapMethod · 0.45
collectMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected