Store a leaf in the CRDT tables.
(
txn: &mut T,
branch_id: BranchId,
leaf_id: LeafId,
serialized: &SerializedLeaf,
)
| 950 | |
| 951 | /// Store a leaf in the CRDT tables. |
| 952 | fn put_leaf<T: MutTxnT>( |
| 953 | txn: &mut T, |
| 954 | branch_id: BranchId, |
| 955 | leaf_id: LeafId, |
| 956 | serialized: &SerializedLeaf, |
| 957 | ) -> PristineResult<()> { |
| 958 | let key = encode_leaf_id(&leaf_id); |
| 959 | let value = encode_leaf_value(serialized); |
| 960 | |
| 961 | txn.put_crdt_leaf(&key, &value)?; |
| 962 | |
| 963 | // Update branch->leaf ordering |
| 964 | let branch_key = encode_branch_id(&branch_id); |
| 965 | txn.put_crdt_branch_leaf(&branch_key, &key)?; |
| 966 | |
| 967 | Ok(()) |
| 968 | } |
| 969 | |
| 970 | /// Update a leaf's state. |
| 971 | fn update_leaf_state<T: MutTxnT>( |
no test coverage detected