[][src]Struct gotham::test::TestClient

pub struct TestClient<TS: Server, C: Connect> { /* fields omitted */ }

Client interface for issuing requests to a Server.

Implementations

impl<TS: Server + 'static, C: Connect + Clone + Send + Sync + 'static> TestClient<TS, C>[src]

pub fn head<U>(&self, uri: U) -> TestRequest<TS, C> where
    Uri: TryFrom<U>,
    <Uri as TryFrom<U>>::Error: Into<Error>, 
[src]

Begin constructing a HEAD request using this TestClient.

pub fn get<U>(&self, uri: U) -> TestRequest<TS, C> where
    Uri: TryFrom<U>,
    <Uri as TryFrom<U>>::Error: Into<Error>, 
[src]

Begin constructing a GET request using this TestClient.

pub fn options<U>(&self, uri: U) -> TestRequest<TS, C> where
    Uri: TryFrom<U>,
    <Uri as TryFrom<U>>::Error: Into<Error>, 
[src]

Begin constructing an OPTIONS request using this TestClient.

pub fn post<B, U>(&self, uri: U, body: B, mime: Mime) -> TestRequest<TS, C> where
    B: Into<Body>,
    Uri: TryFrom<U>,
    <Uri as TryFrom<U>>::Error: Into<Error>, 
[src]

Begin constructing a POST request using this TestClient.

pub fn put<B, U>(&self, uri: U, body: B, mime: Mime) -> TestRequest<TS, C> where
    B: Into<Body>,
    Uri: TryFrom<U>,
    <Uri as TryFrom<U>>::Error: Into<Error>, 
[src]

Begin constructing a PUT request using this TestClient.

pub fn patch<B, U>(&self, uri: U, body: B, mime: Mime) -> TestRequest<TS, C> where
    B: Into<Body>,
    Uri: TryFrom<U>,
    <Uri as TryFrom<U>>::Error: Into<Error>, 
[src]

Begin constructing a PATCH request using this TestClient.

pub fn delete<U>(&self, uri: U) -> TestRequest<TS, C> where
    Uri: TryFrom<U>,
    <Uri as TryFrom<U>>::Error: Into<Error>, 
[src]

Begin constructing a DELETE request using this TestClient.

pub fn build_request<U>(&self, method: Method, uri: U) -> TestRequest<TS, C> where
    Uri: TryFrom<U>,
    <Uri as TryFrom<U>>::Error: Into<Error>, 
[src]

Begin constructing a request with the given HTTP method and URI.

pub fn build_request_with_body<B, U>(
    &self,
    method: Method,
    uri: U,
    body: B,
    mime: Mime
) -> TestRequest<TS, C> where
    B: Into<Body>,
    Uri: TryFrom<U>,
    <Uri as TryFrom<U>>::Error: Into<Error>, 
[src]

Begin constructing a request with the given HTTP method, URI and body.

pub fn perform(&self, req: TestRequest<TS, C>) -> Result<TestResponse>[src]

Send a constructed request using this TestClient, and await the response.

Auto Trait Implementations

impl<TS, C> !RefUnwindSafe for TestClient<TS, C>

impl<TS, C> Send for TestClient<TS, C> where
    C: Send,
    TS: Send

impl<TS, C> Sync for TestClient<TS, C> where
    C: Sync,
    TS: Sync

impl<TS, C> Unpin for TestClient<TS, C> where
    C: Unpin,
    TS: Unpin

impl<TS, C> !UnwindSafe for TestClient<TS, C>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Sealed<T> for T where
    T: ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.