Struct aws_smithy_runtime::client::http::test_util::dvr::ReplayingClient
source · pub struct ReplayingClient { /* private fields */ }
Available on crate features
client
and test-util
and connector-hyper-0-14-x
only.Expand description
Replay traffic recorded by a RecordingClient
Implementations§
source§impl ReplayingClient
impl ReplayingClient
sourcepub async fn full_validate(self, media_type: &str) -> Result<(), Box<dyn Error>>
pub async fn full_validate(self, media_type: &str) -> Result<(), Box<dyn Error>>
Validate all headers and bodies
sourcepub async fn validate(
self,
checked_headers: &[&str],
body_comparer: impl Fn(&[u8], &[u8]) -> Result<(), Box<dyn Error>>
) -> Result<(), Box<dyn Error>>
pub async fn validate( self, checked_headers: &[&str], body_comparer: impl Fn(&[u8], &[u8]) -> Result<(), Box<dyn Error>> ) -> Result<(), Box<dyn Error>>
Validate actual requests against expected requests
sourcepub async fn validate_body_and_headers(
self,
checked_headers: Option<&[&str]>,
media_type: &str
) -> Result<(), Box<dyn Error>>
pub async fn validate_body_and_headers( self, checked_headers: Option<&[&str]>, media_type: &str ) -> Result<(), Box<dyn Error>>
Validate that the bodies match, using a given MediaType
for comparison
The specified headers are also validated
sourcepub async fn take_requests(self) -> Vec<Request<Bytes>>
pub async fn take_requests(self) -> Vec<Request<Bytes>>
Return all the recorded requests for further analysis
Trait Implementations§
source§impl Clone for ReplayingClient
impl Clone for ReplayingClient
source§fn clone(&self) -> ReplayingClient
fn clone(&self) -> ReplayingClient
Returns a copy 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 moresource§impl Debug for ReplayingClient
impl Debug for ReplayingClient
source§impl HttpClient for ReplayingClient
impl HttpClient for ReplayingClient
source§fn http_connector(
&self,
_: &HttpConnectorSettings,
_: &RuntimeComponents
) -> SharedHttpConnector
fn http_connector( &self, _: &HttpConnectorSettings, _: &RuntimeComponents ) -> SharedHttpConnector
Returns a HTTP connector based on the requested connector settings. Read more
source§impl HttpConnector for ReplayingClient
impl HttpConnector for ReplayingClient
source§fn call(&self, request: HttpRequest) -> HttpConnectorFuture
fn call(&self, request: HttpRequest) -> HttpConnectorFuture
Asynchronously converts a request into a response.
Auto Trait Implementations§
impl Freeze for ReplayingClient
impl !RefUnwindSafe for ReplayingClient
impl Send for ReplayingClient
impl Sync for ReplayingClient
impl Unpin for ReplayingClient
impl !UnwindSafe for ReplayingClient
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Creates a shared type from an unshared type.