pub trait ScratchpadStore: Send + Sync {
// Required methods
fn set(&self, key: &str, value: String);
fn get(&self, key: &str) -> Option<String>;
fn entries(&self) -> BTreeMap<String, String>;
fn clear(&self);
fn keys_count(&self) -> u64;
fn state_chars(&self) -> u64;
}Expand description
A session store for the scratchpad <state> (Step 26.4). &self methods
(interior mutability) so a single shared &dyn ScratchpadStore serves both
the per-turn injection and the tool-mutation path.
Required Methods§
Sourcefn entries(&self) -> BTreeMap<String, String>
fn entries(&self) -> BTreeMap<String, String>
A sorted snapshot of all entries (for the <state> block).
Sourcefn keys_count(&self) -> u64
fn keys_count(&self) -> u64
Number of keys held (for /context stats).
Sourcefn state_chars(&self) -> u64
fn state_chars(&self) -> u64
Total chars across all values (for /context stats).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".