6 #ifndef KAGOME_READABLE_HPP 7 #define KAGOME_READABLE_HPP 26 virtual outcome::result<bool>
contains(
const Key &key)
const = 0;
31 virtual bool empty()
const = 0;
39 template <
typename K,
typename V>
53 virtual outcome::result<ConstValueView>
get(
const Key &key)
const = 0;
60 virtual outcome::result<std::optional<ConstValueView>> tryGet(
61 const Key &key)
const = 0;
64 template <
typename K,
typename V>
76 virtual outcome::result<V> load(
const Key &key)
const = 0;
83 virtual outcome::result<std::optional<V>> tryLoad(
const Key &key)
const = 0;
88 #endif // KAGOME_READABLE_HPP Class represents arbitrary (including empty) byte buffer.
A mixin for read-only map.
std::reference_wrapper< const Buffer > ConstValueView
std::reference_wrapper< Buffer > ValueView
virtual ~ReadableBase()=default
virtual bool empty() const =0
Returns true if the storage is empty.
virtual outcome::result< bool > contains(const Key &key) const =0
Checks if given key-value binding exists in the storage.