pub struct MockState { /* private fields */ }Expand description
Shared request-fact recorder. Cheap to clone; all clones share state.
Implementations§
Source§impl MockState
impl MockState
Sourcepub fn call_count(&self) -> usize
pub fn call_count(&self) -> usize
Total requests served.
Sourcepub fn tools_declared_count(&self) -> usize
pub fn tools_declared_count(&self) -> usize
Requests that carried a tools array (of any content).
Sourcepub fn declared_tool_names(&self) -> Vec<String>
pub fn declared_tool_names(&self) -> Vec<String>
Every tool name declared across all requests (with repetition).
Sourcepub fn declared_count_of(&self, name: &str) -> usize
pub fn declared_count_of(&self, name: &str) -> usize
How many times name was declared across all requests.
Sourcepub fn tool_result_ids(&self) -> Vec<String>
pub fn tool_result_ids(&self) -> Vec<String>
The tool_call_id / tool_use_id of every tool result seen in
requests, in order. A missing id is recorded as an empty string so
callers can assert its absence.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MockState
impl RefUnwindSafe for MockState
impl Send for MockState
impl Sync for MockState
impl Unpin for MockState
impl UnsafeUnpin for MockState
impl UnwindSafe for MockState
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