Store a branch in the CRDT tables.
(
txn: &mut T,
trunk_id: TrunkId,
branch_id: BranchId,
serialized: &SerializedBranch,
)
| 1070 | |
| 1071 | /// Store a branch in the CRDT tables. |
| 1072 | fn put_branch<T: MutTxnT>( |
| 1073 | txn: &mut T, |
| 1074 | trunk_id: TrunkId, |
| 1075 | branch_id: BranchId, |
| 1076 | serialized: &SerializedBranch, |
| 1077 | ) -> PristineResult<()> { |
| 1078 | let key = encode_branch_id(&branch_id); |
| 1079 | let value = encode_branch_value(serialized); |
| 1080 | |
| 1081 | txn.put_crdt_branch(&key, &value)?; |
| 1082 | |
| 1083 | // Update trunk->branch ordering |
| 1084 | let trunk_key = encode_trunk_id(&trunk_id); |
| 1085 | txn.put_crdt_trunk_branch(&trunk_key, &key)?; |
| 1086 | |
| 1087 | Ok(()) |
| 1088 | } |
| 1089 | |
| 1090 | /// Update a branch's state. |
| 1091 | fn update_branch_state<T: MutTxnT>( |
no test coverage detected