37 size_t old_value_size = it->second.size();
38 BOOST_ASSERT(
size_ >= old_value_size);
39 size_ -= old_value_size;
41 size_ += value.size();
43 return outcome::success();
50 size_t old_value_size = it->second.size();
51 BOOST_ASSERT(
size_ >= old_value_size);
52 size_ -= old_value_size;
54 size_ += value.size();
56 return outcome::success();
70 size_ -= it->second.size();
73 return outcome::success();
76 std::unique_ptr<kagome::storage::face::WriteBatch<BufferView, Buffer>>
78 return std::make_unique<InMemoryBatch>(*this);
Class represents arbitrary (including empty) byte buffer.
outcome::result< common::Buffer > load(const common::BufferView &key) const override
SLBuffer< std::numeric_limits< size_t >::max()> Buffer
std::unique_ptr< storage::BufferStorage::Cursor > cursor() override
Returns new key-value iterator.
size_t size() const override
outcome::result< bool > contains(const common::BufferView &key) const override
std::map< std::string, common::Buffer > storage
outcome::result< std::optional< common::Buffer > > tryLoad(const common::BufferView &key) const override
outcome::result< void > remove(const common::BufferView &key) override
bool empty() const override
Returns true if the storage is empty.
outcome::result< void > put(const common::BufferView &key, const common::Buffer &value) override
std::unique_ptr< kagome::storage::face::WriteBatch< common::BufferView, common::Buffer > > batch() override
Creates new Write Batch - an object, which can be used to efficiently write bulk data.
std::string toHex() const