Resolve an index to a hash, erroring if it's `NONE` or out of bounds. Unlike [`resolve_or_none`](Self::resolve_or_none), this method treats [`HASH_INDEX_NONE`] as an error. Use this when you need an actual hash (e.g., resolving a dependency index). # Arguments `index` - The `HashIndex` to resolve. # Errors - [`FormatError::HashIndexOutOfBounds`] if the index is `HASH_INDEX_NONE` or exceeds th
(&self, index: HashIndex)
| 407 | /// - [`FormatError::HashIndexOutOfBounds`] if the index is `HASH_INDEX_NONE` |
| 408 | /// or exceeds the table size. |
| 409 | pub fn resolve_required(&self, index: HashIndex) -> FormatResult<&[u8; 32]> { |
| 410 | if index == HASH_INDEX_NONE || (index as usize) >= self.hashes.len() { |
| 411 | return Err(FormatError::HashIndexOutOfBounds { |
| 412 | index, |
| 413 | table_size: self.hashes.len() as u16, |
| 414 | }); |
| 415 | } |
| 416 | Ok(&self.hashes[index as usize]) |
| 417 | } |
| 418 | |
| 419 | /// Returns `true` if the table contains the given hash. |
| 420 | /// |