pub struct TestRequest { /* private fields */ }Expand description
A request under construction
Implementations§
Source§impl TestRequest
impl TestRequest
pub fn header(self, name: &str, value: &str) -> Self
pub fn bearer(self, token: &str) -> Self
Send a cookie in addition to those from the jar
pub fn json<T: Serialize>(self, value: &T) -> Self
pub fn text(self, body: &str) -> Self
pub fn body(self, body: impl Into<Bytes>) -> Self
Sourcepub fn remote_addr(self, addr: impl Into<SocketAddr>) -> Self
pub fn remote_addr(self, addr: impl Into<SocketAddr>) -> Self
Pretend the request comes from this peer address
pub async fn send(self) -> TestResponse
Auto Trait Implementations§
impl !Freeze for TestRequest
impl !RefUnwindSafe for TestRequest
impl !UnwindSafe for TestRequest
impl Send for TestRequest
impl Sync for TestRequest
impl Unpin for TestRequest
impl UnsafeUnpin for TestRequest
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