pub struct MockClient { /* private fields */ }
Expand description
Mock client that fails when no responses are available
Implementations§
Source§impl MockClient
impl MockClient
Sourcepub fn new() -> (Self, Arc<MockHandle>)
pub fn new() -> (Self, Arc<MockHandle>)
Create a new MockClient with a weak reference to the handle Returns (client, strong_handle) where the client holds a weak reference
Sourcepub fn with_responses(responses: Vec<MockResponse>) -> (Self, Arc<MockHandle>)
pub fn with_responses(responses: Vec<MockResponse>) -> (Self, Arc<MockHandle>)
Create a MockClient with predefined responses
Trait Implementations§
Source§impl Clone for MockClient
impl Clone for MockClient
Source§impl Debug for MockClient
impl Debug for MockClient
Source§impl LowLevelClient for MockClient
impl LowLevelClient for MockClient
Source§fn ask_raw<'life0, 'async_trait>(
&'life0 self,
_prompt: String,
) -> Pin<Box<dyn Future<Output = Result<String, AIError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ask_raw<'life0, 'async_trait>(
&'life0 self,
_prompt: String,
) -> Pin<Box<dyn Future<Output = Result<String, AIError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The only method that implementations must provide
Source§fn clone_box(&self) -> Box<dyn LowLevelClient>
fn clone_box(&self) -> Box<dyn LowLevelClient>
Clone this client into a boxed trait object
Auto Trait Implementations§
impl Freeze for MockClient
impl RefUnwindSafe for MockClient
impl Send for MockClient
impl Sync for MockClient
impl Unpin for MockClient
impl UnwindSafe for MockClient
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