MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / scan_basic

Function scan_basic

nodedb/src/engine/kv/scan.rs:182–191  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180
181 #[test]
182 fn scan_basic() {
183 let mut t = KvHashTable::new(16, 0.75, 4, 64);
184 for i in 0..5u8 {
185 t.put(&[i], &[i * 10], NO_EXPIRY, Surrogate::ZERO);
186 }
187
188 let (entries, next) = t.scan(0, 100, 0, None);
189 assert_eq!(entries.len(), 5);
190 assert_eq!(next, 0); // Scan complete.
191 }
192
193 #[test]
194 fn scan_with_count_limit() {

Callers

nothing calls this directly

Calls 2

putMethod · 0.45
scanMethod · 0.45

Tested by

no test coverage detected