Store a branch in the CRDT tables.
(
txn: &mut T,
trunk_id: TrunkId,
branch_id: BranchId,
serialized: &SerializedBranch,
)
| 910 | |
| 911 | /// Store a branch in the CRDT tables. |
| 912 | fn put_branch<T: MutTxnT>( |
| 913 | txn: &mut T, |
| 914 | trunk_id: TrunkId, |
| 915 | branch_id: BranchId, |
| 916 | serialized: &SerializedBranch, |
| 917 | ) -> PristineResult<()> { |
| 918 | let key = encode_branch_id(&branch_id); |
| 919 | let value = encode_branch_value(serialized); |
| 920 | |
| 921 | txn.put_crdt_branch(&key, &value)?; |
| 922 | |
| 923 | // Update trunk->branch ordering |
| 924 | let trunk_key = encode_trunk_id(&trunk_id); |
| 925 | txn.put_crdt_trunk_branch(&trunk_key, &key)?; |
| 926 | |
| 927 | Ok(()) |
| 928 | } |
| 929 | |
| 930 | /// Update a branch's state. |
| 931 | fn update_branch_state<T: MutTxnT>( |
no test coverage detected