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

Function handle_encoding_roundtrip

nodedb/src/engine/kv/slab.rs:367–377  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

365
366 #[test]
367 fn handle_encoding_roundtrip() {
368 for tier in 0..7u8 {
369 for slot in [0, 1, 100, SLOT_MASK] {
370 let handle = encode_handle(tier, slot);
371 assert!(!is_large_handle(handle));
372 let (t, s) = decode_handle(handle);
373 assert_eq!(t, tier);
374 assert_eq!(s, slot);
375 }
376 }
377 }
378
379 #[test]
380 fn large_handle_encoding() {

Callers

nothing calls this directly

Calls 2

encode_handleFunction · 0.85
decode_handleFunction · 0.85

Tested by

no test coverage detected