Store a trunk in the CRDT tables.
(
txn: &mut T,
trunk_id: TrunkId,
serialized: &SerializedTrunk,
)
| 842 | |
| 843 | /// Store a trunk in the CRDT tables. |
| 844 | fn put_trunk<T: MutTxnT>( |
| 845 | txn: &mut T, |
| 846 | trunk_id: TrunkId, |
| 847 | serialized: &SerializedTrunk, |
| 848 | ) -> PristineResult<()> { |
| 849 | let key = encode_trunk_id(&trunk_id); |
| 850 | let value = encode_trunk_value(serialized); |
| 851 | |
| 852 | txn.put_crdt_trunk(&key, &value)?; |
| 853 | |
| 854 | // Also update path index |
| 855 | txn.put_crdt_path_trunk(&serialized.path, &key)?; |
| 856 | |
| 857 | // And inode index |
| 858 | txn.put_crdt_inode_trunk(serialized.inode.get(), &key)?; |
| 859 | |
| 860 | Ok(()) |
| 861 | } |
| 862 | |
| 863 | /// Update a trunk's state. |
| 864 | fn update_trunk_state<T: MutTxnT>( |
no test coverage detected