Struct rusoto_mock::MockRequestDispatcher
source · [−]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
sourceimpl 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) -> MockRequestDispatcher where
B: Serialize,
pub fn with_json_body<B>(self, body: B) -> MockRequestDispatcher where
B: Serialize,
Mocks the json serialized response body what would be returned from AWS
sourcepub fn with_request_checker<F>(self, checker: F) -> MockRequestDispatcher where
F: Fn(&SignedRequest) + Send + Sync + 'static,
pub fn with_request_checker<F>(self, checker: F) -> MockRequestDispatcher where
F: Fn(&SignedRequest) + Send + Sync + 'static,
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
sourceimpl Default for MockRequestDispatcher
impl Default for MockRequestDispatcher
sourcefn default() -> MockRequestDispatcher
fn default() -> MockRequestDispatcher
Returns the “default value” for a type. Read more
sourceimpl DispatchSignedRequest for MockRequestDispatcher
impl DispatchSignedRequest for MockRequestDispatcher
sourcefn 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 !RefUnwindSafe for MockRequestDispatcher
impl Send for MockRequestDispatcher
impl Sync for MockRequestDispatcher
impl Unpin for MockRequestDispatcher
impl !UnwindSafe for MockRequestDispatcher
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more