pub struct AgentPool { /* private fields */ }Expand description
Pool of live Agent instances, keyed by AgentId.
Retains agents after execution for:
- State persistence —
export_state()serializes conversation history to JSON for crash recovery, migration, or debugging. - State restoration —
import_state()restores a previous session.
Implementations§
Source§impl AgentPool
impl AgentPool
Sourcepub fn export_state(&self, id: &AgentId) -> Option<Value>
pub fn export_state(&self, id: &AgentId) -> Option<Value>
Export an agent’s state as JSON.
Returns None if the agent is not in the pool or export fails.
Sourcepub fn import_state(&self, id: &AgentId, state: Value) -> bool
pub fn import_state(&self, id: &AgentId, state: Value) -> bool
Import agent state from JSON.
Returns false if the agent is not in the pool or import fails.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AgentPool
impl !RefUnwindSafe for AgentPool
impl !UnwindSafe for AgentPool
impl Send for AgentPool
impl Sync for AgentPool
impl Unpin for AgentPool
impl UnsafeUnpin for AgentPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more