pub struct MockProvider { /* private fields */ }Expand description
A mock Provider for testing.
Responses are consumed from an internal queue in FIFO order. If the queue is empty a default stub response/chunk is returned.
Implementations§
Source§impl MockProvider
impl MockProvider
Sourcepub fn push_response(&self, response: Response)
pub fn push_response(&self, response: Response)
Enqueue a response to be returned by the next call to complete.
Sourcepub fn push_stream(&self, stream_chunks: Vec<Chunk>)
pub fn push_stream(&self, stream_chunks: Vec<Chunk>)
Enqueue a sequence of chunks to be emitted by the next call to stream.
Trait Implementations§
Source§impl Clone for MockProvider
impl Clone for MockProvider
Source§fn clone(&self) -> MockProvider
fn clone(&self) -> MockProvider
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 moreSource§impl Debug for MockProvider
impl Debug for MockProvider
Source§impl Default for MockProvider
impl Default for MockProvider
Auto Trait Implementations§
impl Freeze for MockProvider
impl RefUnwindSafe for MockProvider
impl Send for MockProvider
impl Sync for MockProvider
impl Unpin for MockProvider
impl UnsafeUnpin for MockProvider
impl UnwindSafe for MockProvider
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