Read the entry count from the trailer (second-to-last field before magic).
(buf: &[u8])
| 80 | |
| 81 | /// Read the entry count from the trailer (second-to-last field before magic). |
| 82 | fn read_entry_count(buf: &[u8]) -> Option<u16> { |
| 83 | if buf.len() < TRAILER_SIZE { |
| 84 | return None; |
| 85 | } |
| 86 | let count_start = buf.len() - TRAILER_SIZE; |
| 87 | let bytes = buf.get(count_start..count_start + 2)?; |
| 88 | Some(u16::from_le_bytes([bytes[0], bytes[1]])) |
| 89 | } |
| 90 | |
| 91 | /// Binary search the sorted sidecar entries (in raw byte buffer) for `target` hash. |
| 92 | /// |
no test coverage detected