pub struct MockQueue { /* private fields */ }Expand description
A thread-safe queue of mock responses.
Mock responses are consumed in order - the first infer call gets
the first mock, the second gets the second, etc.
Implementations§
Source§impl MockQueue
impl MockQueue
Sourcepub fn with_responses(responses: Vec<MockResponse>) -> Self
pub fn with_responses(responses: Vec<MockResponse>) -> Self
Create a mock queue with the given responses.
Sourcepub fn push(&self, response: MockResponse)
pub fn push(&self, response: MockResponse)
Add a mock response to the queue.
Sourcepub fn pop(&self) -> Option<MockResponse>
pub fn pop(&self) -> Option<MockResponse>
Pop the next mock response from the queue.
Returns None if the queue is empty.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MockQueue
impl RefUnwindSafe for MockQueue
impl Send for MockQueue
impl Sync for MockQueue
impl Unpin for MockQueue
impl UnsafeUnpin for MockQueue
impl UnwindSafe for MockQueue
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