6 #ifndef KAGOME_STORAGE_TRIE_IMPL_TRIE_STORAGE_BACKEND 7 #define KAGOME_STORAGE_TRIE_IMPL_TRIE_STORAGE_BACKEND 22 std::unique_ptr<Cursor>
cursor()
override;
23 std::unique_ptr<face::WriteBatch<BufferView, Buffer>>
batch()
override;
25 outcome::result<Buffer>
load(
const BufferView &key)
const override;
26 outcome::result<std::optional<Buffer>>
tryLoad(
29 bool empty()
const override;
32 const Buffer &value)
override;
36 size_t size()
const override;
47 #endif // KAGOME_STORAGE_TRIE_IMPL_TRIE_STORAGE_BACKEND Class represents arbitrary (including empty) byte buffer.
outcome::result< bool > contains(const BufferView &key) const override
outcome::result< Buffer > load(const BufferView &key) const override
std::unique_ptr< face::WriteBatch< BufferView, Buffer > > batch() override
Creates new Write Batch - an object, which can be used to efficiently write bulk data.
common::Buffer node_prefix_
size_t size() const override
std::shared_ptr< BufferStorage > storage_
TrieStorageBackendImpl(std::shared_ptr< BufferStorage > storage, common::Buffer node_prefix)
common::Buffer prefixKey(const common::BufferView &key) const
~TrieStorageBackendImpl() override=default
outcome::result< void > put(const BufferView &key, const Buffer &value) override
std::unique_ptr< Cursor > cursor() override
Returns new key-value iterator.
outcome::result< std::optional< Buffer > > tryLoad(const BufferView &key) const override
bool empty() const override
Returns true if the storage is empty.