#[non_exhaustive]pub struct TestRequestBuilder { /* private fields */ }Expand description
A request builder for constructing HTTP requests in tests.
Implements IntoFuture so it can be .awaited directly to send the request.
Implementations§
Source§impl TestRequestBuilder
impl TestRequestBuilder
Sourcepub fn max_body_bytes(self, max_body_bytes: usize) -> Self
pub fn max_body_bytes(self, max_body_bytes: usize) -> Self
Sets a custom response body limit in bytes for this specific request.
Sourcepub fn form<T: Serialize>(self, data: &T) -> Self
pub fn form<T: Serialize>(self, data: &T) -> Self
Sets the URL-encoded form payload for the request.
Sourcepub async fn send(self) -> TestResponse
pub async fn send(self) -> TestResponse
Sends the request and returns the response.
Trait Implementations§
Source§impl IntoFuture for TestRequestBuilder
impl IntoFuture for TestRequestBuilder
Source§type Output = TestResponse
type Output = TestResponse
The output that the future will produce on completion.
Source§type IntoFuture = Pin<Box<dyn Future<Output = <TestRequestBuilder as IntoFuture>::Output> + Send>>
type IntoFuture = Pin<Box<dyn Future<Output = <TestRequestBuilder as IntoFuture>::Output> + Send>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for TestRequestBuilder
impl !Sync for TestRequestBuilder
impl !UnwindSafe for TestRequestBuilder
impl Freeze for TestRequestBuilder
impl Send for TestRequestBuilder
impl Unpin for TestRequestBuilder
impl UnsafeUnpin for TestRequestBuilder
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