| 631 | /// ``` |
| 632 | #[inline] |
| 633 | pub fn encode_leaf_value(data: &SerializedLeaf) -> [u8; 22] { |
| 634 | let mut bytes = [0u8; 22]; |
| 635 | let branch_bytes = encode_branch_id(&data.branch_id); |
| 636 | bytes[0..12].copy_from_slice(&branch_bytes); |
| 637 | bytes[12] = encode_token_kind(data.kind); |
| 638 | bytes[13] = encode_leaf_state(data.state); |
| 639 | bytes[14..18].copy_from_slice(&data.content_start.to_le_bytes()); |
| 640 | bytes[18..22].copy_from_slice(&data.content_end.to_le_bytes()); |
| 641 | bytes |
| 642 | } |
| 643 | |
| 644 | /// Decode leaf data from 22 bytes. |
| 645 | #[inline] |