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§
source§impl<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>
pub fn head<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C>
Begin constructing a HEAD
request using this AsyncTestClient
sourcepub fn get<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C>
pub fn get<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C>
Begin constructing a GET
request using this AsyncTestClient
sourcepub fn options<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C>
pub fn options<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C>
Begin constructing an OPTIONS
request using this AsyncTestClient
sourcepub fn post<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C>
pub fn post<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C>
Begin constructing a POST
request using this AsyncTestClient
sourcepub fn put<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C>
pub fn put<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C>
Begin constructing a PUT
request using this AsyncTestClient
sourcepub fn patch<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C>
pub fn patch<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C>
Begin constructing a PATCH
request using this AsyncTestClient
sourcepub fn delete<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C>
pub fn delete<U>(&self, uri: U) -> AsyncTestRequestBuilder<'_, C>
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§
source§impl<C: Connect> From<AsyncTestClient<C>> for Client<C>
impl<C: Connect> From<AsyncTestClient<C>> for Client<C>
source§fn from(test_client: AsyncTestClient<C>) -> Self
fn from(test_client: AsyncTestClient<C>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<C> Freeze for AsyncTestClient<C>where
C: Freeze,
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§
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