Store a trunk in the CRDT tables.
(
txn: &mut T,
trunk_id: TrunkId,
serialized: &SerializedTrunk,
)
| 999 | |
| 1000 | /// Store a trunk in the CRDT tables. |
| 1001 | fn put_trunk<T: MutTxnT>( |
| 1002 | txn: &mut T, |
| 1003 | trunk_id: TrunkId, |
| 1004 | serialized: &SerializedTrunk, |
| 1005 | ) -> PristineResult<()> { |
| 1006 | let key = encode_trunk_id(&trunk_id); |
| 1007 | let value = encode_trunk_value(serialized); |
| 1008 | |
| 1009 | txn.put_crdt_trunk(&key, &value)?; |
| 1010 | |
| 1011 | // Also update path index |
| 1012 | txn.put_crdt_path_trunk(&serialized.path, &key)?; |
| 1013 | |
| 1014 | // And inode index |
| 1015 | txn.put_crdt_inode_trunk(serialized.inode.get(), &key)?; |
| 1016 | |
| 1017 | Ok(()) |
| 1018 | } |
| 1019 | |
| 1020 | /// Update a trunk's state. |
| 1021 | fn update_trunk_state<T: MutTxnT>( |
no test coverage detected