| 1816 | } |
| 1817 | |
| 1818 | fn get_crdt_leaf( |
| 1819 | &self, |
| 1820 | key: &[u8; 12], |
| 1821 | ) -> PristineResult<Option<crate::crdt::tables::SerializedLeaf>> { |
| 1822 | use crate::crdt::tables::{decode_leaf_value, LEAVES}; |
| 1823 | let table = crdt_table_opt!(self, LEAVES); |
| 1824 | let result = match table.get(key)? { |
| 1825 | Some(guard) => { |
| 1826 | let bytes: [u8; 22] = *guard.value(); |
| 1827 | Some(decode_leaf_value(&bytes)) |
| 1828 | } |
| 1829 | None => None, |
| 1830 | }; |
| 1831 | Ok(result) |
| 1832 | } |
| 1833 | |
| 1834 | fn get_trunk_by_path(&self, path: &str) -> PristineResult<Option<crate::crdt::TrunkId>> { |
| 1835 | use crate::crdt::tables::{decode_trunk_id, PATH_TRUNK}; |