Store a leaf in the CRDT tables.
(
txn: &mut T,
branch_id: BranchId,
leaf_id: LeafId,
serialized: &SerializedLeaf,
)
| 1110 | |
| 1111 | /// Store a leaf in the CRDT tables. |
| 1112 | fn put_leaf<T: MutTxnT>( |
| 1113 | txn: &mut T, |
| 1114 | branch_id: BranchId, |
| 1115 | leaf_id: LeafId, |
| 1116 | serialized: &SerializedLeaf, |
| 1117 | ) -> PristineResult<()> { |
| 1118 | let key = encode_leaf_id(&leaf_id); |
| 1119 | let value = encode_leaf_value(serialized); |
| 1120 | |
| 1121 | txn.put_crdt_leaf(&key, &value)?; |
| 1122 | |
| 1123 | // Update branch->leaf ordering |
| 1124 | let branch_key = encode_branch_id(&branch_id); |
| 1125 | txn.put_crdt_branch_leaf(&branch_key, &key)?; |
| 1126 | |
| 1127 | Ok(()) |
| 1128 | } |
| 1129 | |
| 1130 | /// Update a leaf's state. |
| 1131 | fn update_leaf_state<T: MutTxnT>( |
no test coverage detected