6 #ifndef KAGOME_STORAGE_TRIE_IMPL_EPHEMERAL_TRIE_BATCH 7 #define KAGOME_STORAGE_TRIE_IMPL_EPHEMERAL_TRIE_BATCH 18 std::shared_ptr<PolkadotTrie> trie);
21 outcome::result<BufferConstRef>
get(
const BufferView &key)
const override;
22 outcome::result<std::optional<BufferConstRef>>
tryGet(
24 std::unique_ptr<PolkadotTrieCursor>
trieCursor()
override;
26 bool empty()
const override;
27 outcome::result<std::tuple<bool, uint32_t>>
clearPrefix(
29 std::optional<uint64_t> limit = std::nullopt)
override;
31 const Buffer &value)
override;
33 outcome::result<void>
remove(
const BufferView &key)
override;
34 outcome::result<RootHash>
hash()
override;
38 std::shared_ptr<PolkadotTrie>
trie_;
43 #endif // KAGOME_STORAGE_TRIE_IMPL_EPHEMERAL_TRIE_BATCH Class represents arbitrary (including empty) byte buffer.
std::shared_ptr< Codec > codec_
std::unique_ptr< PolkadotTrieCursor > trieCursor() override
bool empty() const override
Returns true if the storage is empty.
outcome::result< void > put(const BufferView &key, const Buffer &value) override
Store value by key.
std::shared_ptr< PolkadotTrie > trie_
outcome::result< std::tuple< bool, uint32_t > > clearPrefix(const BufferView &prefix, std::optional< uint64_t > limit=std::nullopt) override
outcome::result< std::optional< BufferConstRef > > tryGet(const BufferView &key) const override
Get value by key.
outcome::result< RootHash > hash() override
EphemeralTrieBatchImpl(std::shared_ptr< Codec > codec, std::shared_ptr< PolkadotTrie > trie)
outcome::result< bool > contains(const BufferView &key) const override
Checks if given key-value binding exists in the storage.
~EphemeralTrieBatchImpl() override=default