Rust

memory

Module

Memory and [None]: in-process adapters.

Contents

use utopia_cache::Memory;
Rust
pub struct Memory

Entries in this process, gone when it exits. Hashes are ignored: one entry per key.

Rust
use php_std::types::Value;
use utopia_cache::{Adapter, Memory};

let memory = Memory::new();
memory.save("greeting", &Value::from("hello"), "", 0).await?;
assert_eq!(memory.load("greeting", 60, "").await?, Some(Value::from("hello")));
assert_eq!(memory.size().await?, 1);