pub struct MockRequestDispatcher { /* private fields */ }
Expand description
Composes mock API responses
A Default is provided which returns an successful response with an empty body
These can be constructed using either a Default implementation or with the with_status function.
Implementations§
Source§impl MockRequestDispatcher
impl MockRequestDispatcher
Sourcepub fn with_status(status: u16) -> MockRequestDispatcher
pub fn with_status(status: u16) -> MockRequestDispatcher
Returns a instance that mocks the status code that would be returned from AWS
Sourcepub fn with_dispatch_error(error: HttpDispatchError) -> MockRequestDispatcher
pub fn with_dispatch_error(error: HttpDispatchError) -> MockRequestDispatcher
Mocks the service request failing with a communications error
Sourcepub fn with_body(self, body: &str) -> MockRequestDispatcher
pub fn with_body(self, body: &str) -> MockRequestDispatcher
Mocks the service response body what would be returned from AWS
Sourcepub fn with_json_body<B>(self, body: B) -> MockRequestDispatcherwhere
B: Serialize,
pub fn with_json_body<B>(self, body: B) -> MockRequestDispatcherwhere
B: Serialize,
Mocks the json serialized response body what would be returned from AWS
Sourcepub fn with_request_checker<F>(self, checker: F) -> MockRequestDispatcher
pub fn with_request_checker<F>(self, checker: F) -> MockRequestDispatcher
Mocks the signed request checking applied to a request before sending to AWS
Sourcepub fn with_header(self, key: &str, value: &str) -> MockRequestDispatcher
pub fn with_header(self, key: &str, value: &str) -> MockRequestDispatcher
Mocks a single service header that would be returned from AWS
Trait Implementations§
Source§impl Default for MockRequestDispatcher
impl Default for MockRequestDispatcher
Source§fn default() -> MockRequestDispatcher
fn default() -> MockRequestDispatcher
Returns the “default value” for a type. Read more
Source§impl DispatchSignedRequest for MockRequestDispatcher
impl DispatchSignedRequest for MockRequestDispatcher
Source§fn dispatch(
&self,
request: SignedRequest,
_timeout: Option<Duration>,
) -> DispatchSignedRequestFuture
fn dispatch( &self, request: SignedRequest, _timeout: Option<Duration>, ) -> DispatchSignedRequestFuture
Dispatch Request, and then return a Response
Auto Trait Implementations§
impl Freeze for MockRequestDispatcher
impl !RefUnwindSafe for MockRequestDispatcher
impl Send for MockRequestDispatcher
impl Sync for MockRequestDispatcher
impl Unpin for MockRequestDispatcher
impl !UnwindSafe for MockRequestDispatcher
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