pub struct MockHandle { /* private fields */ }
Expand description
Handle for configuring mock responses from outside
Implementations§
Source§impl MockHandle
impl MockHandle
Sourcepub fn add_response(&self, response: MockResponse)
pub fn add_response(&self, response: MockResponse)
Add a single response to the queue
Sourcepub fn add_responses(&self, responses: Vec<MockResponse>)
pub fn add_responses(&self, responses: Vec<MockResponse>)
Add multiple responses to the queue
Sourcepub fn add_json_response(&self, json: &str)
pub fn add_json_response(&self, json: &str)
Add a successful JSON response
Sourcepub fn add_json_responses(&self, jsons: Vec<&str>)
pub fn add_json_responses(&self, jsons: Vec<&str>)
Add multiple successful JSON responses
Sourcepub fn remaining_count(&self) -> usize
pub fn remaining_count(&self) -> usize
Get the number of remaining responses
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MockHandle
impl RefUnwindSafe for MockHandle
impl Send for MockHandle
impl Sync for MockHandle
impl Unpin for MockHandle
impl UnwindSafe for MockHandle
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