Expand description
Utilities for interacting with the native key-value storage.
Modules§
Structs§
- Composite
Key - A key with an arbitrary number of segments. Writes them in order of the iteration.
- Fixed
Segment Size Key - A key with a pre-defined number of segments. Writes them in order of the iteration.
- Item
Space - Storage type that stores many items under the given
Namespace
. The key can be anything that implementsKey
and the most suitable type of key should be chosen depending on the scenario. - Single
Item - Storage type that stores a single item under the given
Namespace
. Use this when there is only “one of” something. - Static
Key - A key which consists of a static byte slice.
- Typed
Key - A strongly-typed key with segments defined by the concrete type
which must implement
Segment
. For typed keys which consist of multiple types useTypedKey2
,TypedKey3
andTypedKey4
. Constructs the key in order of definition. - Typed
Key2 - Typed
Key3 - Typed
Key4
Traits§
- Key
- Implemented for types that act as CW storage keys by writing bytes into the given buffer. What those bytes represent and where they are coming from as well as how they are written into the buffer entirely depends on the implementing type.
- Namespace
- Represents a namespace, usually acting as a prefix
to a dynamically generated key. We only do this so
that we can have strongly typed keys and storage types.
Use the
namespace
macro to generate one. - Segment
- Represents types that can be used to construct a
TypedKey
and its variants. Although it has the exact same method definitions as theKey
trait, it differs in its specific usage scenario and as such the two traits are not connected in any way at the type level.
Functions§
- load
- Load something from the storage.
- remove
- Remove something from the storage.
- save
- Save something to the storage.