Struct httptest::ExpectationBuilder [−][src]
pub struct ExpectationBuilder { /* fields omitted */ }
Expand description
Define expectations using a builder pattern.
Implementations
Expect this many requests.
// exactly 2 requests
Expectation::matching(any()).times(2).respond_with(status_code(200));
// at least 2 requests
Expectation::matching(any()).times(2..).respond_with(status_code(200));
// at most 2 requests
Expectation::matching(any()).times(..=2).respond_with(status_code(200));
// between 2 and 5 inclusive
Expectation::matching(any()).times(2..6).respond_with(status_code(200));
// equivalently
Expectation::matching(any()).times(2..=5).respond_with(status_code(200));
What should this expectation respond with.
Auto Trait Implementations
impl !RefUnwindSafe for ExpectationBuilder
impl Send for ExpectationBuilder
impl !Sync for ExpectationBuilder
impl Unpin for ExpectationBuilder
impl !UnwindSafe for ExpectationBuilder
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more