Expand description
Shared key-value state for sub-agent communication.
SharedState is a pluggable key-value store that multiple sub-agents (and
the parent) can read/write. The default backend is in-memory; a filesystem
backend is also available for persistence and large artifacts.
§Example
use yoagent::shared_state::SharedState;
let state = SharedState::new();
state.set("log", "big CI output...".into()).await.unwrap();
assert_eq!(state.get("log").await, Some("big CI output...".into()));
assert_eq!(state.keys().await, vec!["log"]);Structs§
- Capacity
Error - Error returned when a
setwould exceed the capacity limit. - File
Backend - Filesystem backend — each key is stored as a file in a directory.
- Memory
Backend - In-memory backend backed by
HashMapwith a byte capacity limit. - Shared
State - A shared string key-value store for sub-agent communication.
Enums§
- Shared
State Error - Error type for shared state operations.
Traits§
- Shared
State Backend - Pluggable storage backend for
SharedState.