pub struct MockExpectations { /* private fields */ }Expand description
Expectations set on a mock endpoint for batch-style assertion.
Use crate::MockEndpointInner::expect_body,
crate::MockEndpointInner::expect_body_matcher,
crate::MockEndpointInner::expect_header and
crate::MockEndpointInner::expect_header_matcher to populate
expectations, then call crate::MockEndpointInner::assert_satisfied
after exchanges have been received.
Implementations§
Source§impl MockExpectations
impl MockExpectations
Sourcepub fn push_body_matcher(&mut self, matcher: BodyMatcher)
pub fn push_body_matcher(&mut self, matcher: BodyMatcher)
Add an expected body matcher.
Sourcepub fn push_header(&mut self, key: String, value: Value)
pub fn push_header(&mut self, key: String, value: Value)
Add an expected header key-value pair.
Sourcepub fn push_header_regex(&mut self, key: String, pattern: String)
pub fn push_header_regex(&mut self, key: String, pattern: String)
Add an expected header regex pattern.
Sourcepub fn push_header_matcher(&mut self, key: String, matcher: HeaderMatcher)
pub fn push_header_matcher(&mut self, key: String, matcher: HeaderMatcher)
Add an expected header matcher.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for MockExpectations
impl !UnwindSafe for MockExpectations
impl Freeze for MockExpectations
impl Send for MockExpectations
impl Sync for MockExpectations
impl Unpin for MockExpectations
impl UnsafeUnpin for MockExpectations
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