6 #ifndef KAGOME_IN_MEMORY_BATCH_HPP 7 #define KAGOME_IN_MEMORY_BATCH_HPP 21 const Buffer &value)
override {
23 return outcome::success();
28 return outcome::success();
31 outcome::result<void>
remove(
const BufferView &key)
override {
33 return outcome::success();
36 outcome::result<void>
commit()
override {
40 return outcome::success();
53 #endif // KAGOME_IN_MEMORY_BATCH_HPP void clear() override
Clear batch.
static outcome::result< SLBuffer > fromHex(std::string_view hex)
Construct SLBuffer from hex string.
Class represents arbitrary (including empty) byte buffer.
An abstraction over a storage, which can be used for batch writes.
InMemoryBatch(InMemoryStorage &db)
outcome::result< void > put(const BufferView &key, Buffer &&value) override
std::map< std::string, Buffer > entries
SLBuffer< std::numeric_limits< size_t >::max()> Buffer
outcome::result< void > put(const BufferView &key, const Buffer &value) override
Store value by key.
outcome::result< void > commit() override
Writes batch.
outcome::result< void > put(const common::BufferView &key, const common::Buffer &value) override
std::string toHex() const