[cache_check (rust)] Detect structural errors on arrays

- Define error types for arrays
- Propagate low-level errors to tools
- Rename array_block.rs to array.rs
This commit is contained in:
Ming-Hung Tsai
2021-04-13 13:39:14 +08:00
parent ace9c1d1e3
commit 9b4a0607ea
10 changed files with 249 additions and 112 deletions

View File

@@ -209,6 +209,7 @@ fn pack_block<W: Write>(w: &mut W, kind: BT, buf: &[u8]) -> Result<()> {
BT::NODE => pack_btree_node(w, buf).context("unable to pack btree node")?,
BT::INDEX => pack_index(w, buf).context("unable to pack space map index")?,
BT::BITMAP => pack_bitmap(w, buf).context("unable to pack space map bitmap")?,
BT::ARRAY => pack_array(w, buf).context("unable to pack array block")?,
BT::UNKNOWN => return Err(anyhow!("asked to pack an unknown block type")),
}