| 1790 | } |
| 1791 | |
| 1792 | fn get_crdt_leaf( |
| 1793 | &self, |
| 1794 | key: &[u8; 12], |
| 1795 | ) -> PristineResult<Option<crate::crdt::tables::SerializedLeaf>> { |
| 1796 | use crate::crdt::tables::{decode_leaf_value, LEAVES}; |
| 1797 | let table = crdt_table_opt!(self, LEAVES); |
| 1798 | let result = match table.get(key)? { |
| 1799 | Some(guard) => { |
| 1800 | let bytes: [u8; 22] = *guard.value(); |
| 1801 | Some(decode_leaf_value(&bytes)) |
| 1802 | } |
| 1803 | None => None, |
| 1804 | }; |
| 1805 | Ok(result) |
| 1806 | } |
| 1807 | |
| 1808 | fn get_trunk_by_path(&self, path: &str) -> PristineResult<Option<crate::crdt::TrunkId>> { |
| 1809 | use crate::crdt::tables::{decode_trunk_id, PATH_TRUNK}; |