pub struct StateRegistry { /* private fields */ }Expand description
Registry of StateBuckets keyed by arbitrary string.
Implementations§
Source§impl StateRegistry
impl StateRegistry
pub fn new() -> Self
pub fn with_history_cap(history_cap: usize) -> Self
Sourcepub fn with_bucket<R>(
&self,
key: &str,
f: impl FnOnce(&mut StateBucket) -> R,
) -> R
pub fn with_bucket<R>( &self, key: &str, f: impl FnOnce(&mut StateBucket) -> R, ) -> R
Run f with mutable access to the bucket for key, creating if absent.
pub fn history_snapshot(&self, key: &str) -> Vec<ToolCallRecord>
pub fn bucket_count(&self) -> usize
pub const fn history_cap(&self) -> usize
Trait Implementations§
Source§impl Debug for StateRegistry
impl Debug for StateRegistry
Auto Trait Implementations§
impl !Freeze for StateRegistry
impl RefUnwindSafe for StateRegistry
impl Send for StateRegistry
impl Sync for StateRegistry
impl Unpin for StateRegistry
impl UnsafeUnpin for StateRegistry
impl UnwindSafe for StateRegistry
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