Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

ModelValueStorage

A ModelValueStorage trait that abstracts where the storage is.

Fully qualified path: dojo::model::storage::ModelValueStorage

pub trait ModelValueStorage<S, V>

Trait functions

read_value

Retrieves a model value of type V using the provided key of type K.

Fully qualified path: dojo::model::storage::ModelValueStorage::read_value

fn read_value<K, +Drop<K>, +Serde<K>, +ModelValueKey<V, K>>(self: @S, keys: K) -> V

read_values

Retrieves multiple model values of type V using the provided keys of type K.

Fully qualified path: dojo::model::storage::ModelValueStorage::read_values

fn read_values<K, +Drop<K>, +Serde<K>, +ModelValueKey<V, K>>(self: @S, keys: Span<K>) -> Array<V>

read_value_from_id

Retrieves a model value of type V using the provided entity id.

Fully qualified path: dojo::model::storage::ModelValueStorage::read_value_from_id

fn read_value_from_id(self: @S, entity_id: felt252) -> V

read_values_from_ids

Retrieves multiple model values of type V using the provided entity ids.

Fully qualified path: dojo::model::storage::ModelValueStorage::read_values_from_ids

fn read_values_from_ids(self: @S, entity_ids: Span<felt252>) -> Array<V>

write_value

Updates a model value of type V.

Fully qualified path: dojo::model::storage::ModelValueStorage::write_value

fn write_value<K, +Drop<K>, +Serde<K>, +ModelValueKey<V, K>>(ref self: S, keys: K, value: @V)

write_values

Updates multiple model values of type V.

Fully qualified path: dojo::model::storage::ModelValueStorage::write_values

fn write_values<K, +Drop<K>, +Serde<K>, +ModelValueKey<V, K>>(
    ref self: S, keys: Span<K>, values: Span<@V>,
)

write_value_from_id

Updates a model value of type V.

Fully qualified path: dojo::model::storage::ModelValueStorage::write_value_from_id

fn write_value_from_id(ref self: S, entity_id: felt252, value: @V)

write_values_from_ids

Updates multiple model values of type V.

Fully qualified path: dojo::model::storage::ModelValueStorage::write_values_from_ids

fn write_values_from_ids(ref self: S, entity_ids: Span<felt252>, values: Span<@V>)