pub struct MockBackend { /* private fields */ }Expand description
Mock backend that returns pre-scripted responses.
Implementations§
Source§impl MockBackend
impl MockBackend
Sourcepub fn execute(&self, prompt: &str) -> String
pub fn execute(&self, prompt: &str) -> String
Executes a prompt, returning the next scripted response.
Sourcepub fn execution_count(&self) -> usize
pub fn execution_count(&self) -> usize
Returns the number of times execute was called.
Sourcepub fn executions(&self) -> Vec<ExecutionRecord>
pub fn executions(&self) -> Vec<ExecutionRecord>
Returns all execution records.
Trait Implementations§
Source§impl Clone for MockBackend
impl Clone for MockBackend
Source§fn clone(&self) -> MockBackend
fn clone(&self) -> MockBackend
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MockBackend
impl RefUnwindSafe for MockBackend
impl Send for MockBackend
impl Sync for MockBackend
impl Unpin for MockBackend
impl UnwindSafe for MockBackend
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