| 1168 | } |
| 1169 | |
| 1170 | fn get_crdt_branch( |
| 1171 | &self, |
| 1172 | key: &[u8; 12], |
| 1173 | ) -> PristineResult<Option<crate::crdt::tables::SerializedBranch>> { |
| 1174 | use crate::crdt::tables::{decode_branch_value, BRANCHES}; |
| 1175 | let table = crdt_table_opt!(self, BRANCHES); |
| 1176 | let result = match table.get(key)? { |
| 1177 | Some(guard) => { |
| 1178 | let bytes: [u8; 24] = *guard.value(); |
| 1179 | Some(decode_branch_value(&bytes)) |
| 1180 | } |
| 1181 | None => None, |
| 1182 | }; |
| 1183 | Ok(result) |
| 1184 | } |
| 1185 | |
| 1186 | fn get_crdt_branch_after(&self, branch_key: &[u8; 12]) -> PristineResult<Option<[u8; 12]>> { |
| 1187 | use crate::crdt::tables::BRANCH_AFTER; |