| 644 | /// Decode leaf data from 22 bytes. |
| 645 | #[inline] |
| 646 | pub fn decode_leaf_value(bytes: &[u8; 22]) -> SerializedLeaf { |
| 647 | let branch_id = decode_branch_id(bytes[0..12].try_into().unwrap()); |
| 648 | let kind = decode_token_kind(bytes[12]); |
| 649 | let state = decode_leaf_state(bytes[13]); |
| 650 | let content_start = u32::from_le_bytes(bytes[14..18].try_into().unwrap()); |
| 651 | let content_end = u32::from_le_bytes(bytes[18..22].try_into().unwrap()); |
| 652 | SerializedLeaf { |
| 653 | branch_id, |
| 654 | kind, |
| 655 | state, |
| 656 | content_start, |
| 657 | content_end, |
| 658 | } |
| 659 | } |
| 660 | |
| 661 | // Trunk Value Encoding/Decoding (Variable Length) |
| 662 | |