Struct gotham::test::TestClient [−][src]
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]
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
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]
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
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]
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
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]
B: Into<Body>,
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
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]
B: Into<Body>,
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
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]
B: Into<Body>,
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
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]
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
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]
Uri: TryFrom<U>,
<Uri as TryFrom<U>>::Error: Into<Error>,
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]
&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>,
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,
C: Send,
TS: Send,
impl<TS, C> Sync for TestClient<TS, C> where
C: Sync,
TS: Sync,
C: Sync,
TS: Sync,
impl<TS, C> Unpin for TestClient<TS, C> where
C: Unpin,
TS: Unpin,
C: Unpin,
TS: Unpin,
impl<TS, C> !UnwindSafe for TestClient<TS, C>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,