Closed partim closed 1 year ago
This method could become KeyValueStore::transaction
if drop the impl KeyValueStoreBackend
for KeyValueStore
. I think it would, in fact, make sense to drop all the backend impls for it and move to regular methods. If nothing else this will save you from having to import those traits. I don’t think someone wants to write code that is generic over a backend but also needs to accept the ‘full store’?
This will help me to achieve the following:
Result<MyValue, MyError>
for TCalling it execute
rather than transaction
is probably better because we do not have proper transactions in all implementations.
This PR adds a method
KeyValueStore::execute
that runs a closure as a transaction but allowing it to return a closure.