GetStorageItem

Function GetStorageItem 

Source
pub fn GetStorageItem(
    TargetObjectValue: Value,
) -> ActionEffect<Arc<dyn StorageProvider>, CommonError, Option<Value>>
Expand description

Creates an effect that, when executed, will retrieve an item from either global or workspace-scoped Memento storage.

It uses the StorageProvider capability from the environment to perform the actual data retrieval from the host’s persistent storage.

§Parameters

  • TargetObjectValue: A serde_json::Value expected to be an object with the following fields:
    • Scope (boolean, optional): true for global scope, false or absent for workspace scope.
    • Key (string, required): The key of the item to retrieve.

§Returns

An ActionEffect that resolves with an Option<Value>, containing the retrieved value or None if the key does not exist.