Skip to main content

Module storage

Module storage 

Source
Expand description

Storage slot abstraction for direct storage access.

This module provides the Slot type for working with individual storage slots and helper functions for deriving storage keys.

§Example

use truthlinked_sdk::storage::Slot;

let slot = Slot::from_label("counter");
slot.write_u64(42)?;
let value = slot.read_u64()?;

Structs§

Slot
A 32-byte storage slot identifier.

Functions§

namespace
Creates a namespace hash from a label.
slot_for
Creates a slot for a namespace and key.
slot_for_parts
Creates a slot for a namespace and multiple key parts.