| 1744 | |
| 1745 | impl crate::pristine::traits::CrdtTxnT for ReadTxn { |
| 1746 | fn get_crdt_trunk( |
| 1747 | &self, |
| 1748 | key: &[u8; 12], |
| 1749 | ) -> PristineResult<Option<crate::crdt::tables::SerializedTrunk>> { |
| 1750 | use crate::crdt::tables::{decode_trunk_value, TRUNKS}; |
| 1751 | let table = crdt_table_opt!(self, TRUNKS); |
| 1752 | let result = match table.get(key)? { |
| 1753 | Some(guard) => { |
| 1754 | let bytes_copy: Vec<u8> = guard.value().to_vec(); |
| 1755 | decode_trunk_value(&bytes_copy) |
| 1756 | } |
| 1757 | None => None, |
| 1758 | }; |
| 1759 | Ok(result) |
| 1760 | } |
| 1761 | |
| 1762 | fn get_crdt_inode_trunk(&self, inode: u64) -> PristineResult<Option<[u8; 12]>> { |
| 1763 | use crate::crdt::tables::INODE_TRUNK; |