Struct gotham::test::AsyncTestClient
source · [−]pub struct AsyncTestClient<C: Connect> { /* private fields */ }
Expand description
Client interface for issuing requests to an [AsyncTestServer
].
Most methods return an AsyncTestRequestBuilder
that can be used to
build a request.
Implementations
sourceimpl<C: Connect + Clone + Send + Sync + 'static> AsyncTestClient<C>
impl<C: Connect + Clone + Send + Sync + 'static> AsyncTestClient<C>
sourcepub async fn request(&self, request: Request<Body>) -> Result<AsyncTestResponse>
pub async fn request(&self, request: Request<Body>) -> Result<AsyncTestResponse>
Performs the given Request
using this AsyncTestClient
sourcepub fn head<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C> where
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
pub fn head<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C> where
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
Begin constructing a HEAD
request using this AsyncTestClient
sourcepub fn get<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C> where
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
pub fn get<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C> where
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
Begin constructing a GET
request using this AsyncTestClient
sourcepub fn options<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C> where
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
pub fn options<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C> where
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
Begin constructing an OPTIONS
request using this AsyncTestClient
sourcepub fn post<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C> where
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
pub fn post<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C> where
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
Begin constructing a POST
request using this AsyncTestClient
sourcepub fn put<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C> where
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
pub fn put<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C> where
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
Begin constructing a PUT
request using this AsyncTestClient
sourcepub fn patch<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C> where
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
pub fn patch<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C> where
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
Begin constructing a PATCH
request using this AsyncTestClient
sourcepub fn delete<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C> where
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
pub fn delete<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C> where
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
Begin constructing a DELETE
request using this AsyncTestClient
sourcepub fn build_request(&self) -> AsyncTestRequestBuilder<'_, C>
pub fn build_request(&self) -> AsyncTestRequestBuilder<'_, C>
Begin constructing a request using this AsyncTestClient
Trait Implementations
sourceimpl<C: Connect> From<AsyncTestClient<C>> for Client<C>
impl<C: Connect> From<AsyncTestClient<C>> for Client<C>
sourcefn from(test_client: AsyncTestClient<C>) -> Self
fn from(test_client: AsyncTestClient<C>) -> Self
Performs the conversion.
Auto Trait Implementations
impl<C> !RefUnwindSafe for AsyncTestClient<C>
impl<C> Send for AsyncTestClient<C> where
C: Send,
impl<C> Sync for AsyncTestClient<C> where
C: Sync,
impl<C> Unpin for AsyncTestClient<C> where
C: Unpin,
impl<C> !UnwindSafe for AsyncTestClient<C>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub 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