Skip to main content

Module shared_state

Module shared_state 

Source
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§

CapacityError
Error returned when a set would exceed the capacity limit.
FileBackend
Filesystem backend — each key is stored as a file in a directory.
MemoryBackend
In-memory backend backed by HashMap with a byte capacity limit.
SharedState
A shared string key-value store for sub-agent communication.

Enums§

SharedStateError
Error type for shared state operations.

Traits§

SharedStateBackend
Pluggable storage backend for SharedState.