pub struct SharedState { /* private fields */ }Expand description
Thread-safe agent state wrapper.
Implementations§
Sourcepub fn get_state(&self) -> AgentState
pub fn get_state(&self) -> AgentState
Obtain a snapshot of the current agent state.
Sourcepub fn update<F>(&self, f: F)where
F: FnOnce(&mut AgentState),
pub fn update<F>(&self, f: F)where
F: FnOnce(&mut AgentState),
Mutably update the agent state under a write lock.
Sourcepub fn reset(&self)
pub fn reset(&self)
Reset the state for a new conversation (delegates to AgentState::clear).
Trait Implementations§
Source§fn clone(&self) -> SharedState
fn clone(&self) -> SharedState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§fn default() -> SharedState
fn default() -> SharedState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
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