fully implement ExtentItem, hex data, node addresses, and some other details

This commit is contained in:
Florian Stecker
2024-03-06 00:50:43 -05:00
parent b41547ddcb
commit 053a8ff77f
7 changed files with 238 additions and 94 deletions

View File

@@ -171,7 +171,7 @@ fn http_main_boxes(image: &[u8], _req: &Request) -> Response {
if let Some(met) = &mut metadata_items {
let bg_start = bg_item.key.key_id;
let node_addr = item.key.key_id;
let tree_id = e.block_refs.iter().filter(|&(t,_)|t == &ItemType::TreeBlockRef).count() as u64;
let tree_id = e.block_refs.iter().count() as u64;
let index = (node_addr - bg_start) as usize / NODE_SIZE;
if index < met.len() {
met[index] = Some((tree_id, item.key.key_offset));