pub struct SharedState(/* private fields */);Expand description
A cheaply-cloneable handle to a tool’s shared key-value state store.
ToolContext keeps its state behind this handle so multiple contexts
(e.g. successive tool calls within the same agent turn) can read and write
the same underlying store. Clone it and hand it to another context via
ToolContext::with_shared_state.
The concrete lock and map types are an implementation detail — they differ
between std and no_std builds — so they are deliberately not exposed.
Implementations§
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 moreAuto 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