6 #ifndef KAGOME_STORAGE_IN_MEMORY_IN_MEMORY_STORAGE_HPP 7 #define KAGOME_STORAGE_IN_MEMORY_IN_MEMORY_STORAGE_HPP 26 outcome::result<common::Buffer>
load(
29 outcome::result<std::optional<common::Buffer>>
tryLoad(
41 bool empty()
const override;
49 std::unique_ptr<storage::BufferStorage::Cursor>
cursor()
override;
51 size_t size()
const override;
54 std::map<std::string, common::Buffer>
storage;
60 #endif // KAGOME_STORAGE_IN_MEMORY_IN_MEMORY_STORAGE_HPP Class represents arbitrary (including empty) byte buffer.
outcome::result< common::Buffer > load(const common::BufferView &key) const override
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
~InMemoryStorage() override=default
outcome::result< std::optional< common::Buffer > > tryLoad(const common::BufferView &key) const 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.