pub struct Expectation { /* private fields */ }Expand description
An expectation for a request
Implementations§
Source§impl Expectation
impl Expectation
Sourcepub fn new(matcher: RequestMatcher) -> Self
pub fn new(matcher: RequestMatcher) -> Self
Create a new expectation
Sourcepub fn respond_with(self, response: MockResponse) -> Self
pub fn respond_with(self, response: MockResponse) -> Self
Set the response to match
Sourcepub fn at_least_once(self) -> Self
pub fn at_least_once(self) -> Self
Expect the request to be called at least once
Trait Implementations§
Source§impl Clone for Expectation
impl Clone for Expectation
Source§fn clone(&self) -> Expectation
fn clone(&self) -> Expectation
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 Expectation
impl RefUnwindSafe for Expectation
impl Send for Expectation
impl Sync for Expectation
impl Unpin for Expectation
impl UnwindSafe for Expectation
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