Struct shs::TestRequest
source · pub struct TestRequest { /* private fields */ }
Expand description
Test request for calling Server::test_request.
Implementations§
source§impl TestRequest
impl TestRequest
sourcepub fn new_with_body(s: &str, body: &[u8]) -> Result<TestRequest, Error>
pub fn new_with_body(s: &str, body: &[u8]) -> Result<TestRequest, Error>
Create a new test request with the method, URL, and body set.
The input string should be in the format “METHOD /path”. The path will automatically be expanded to a full URL: “http://example.com/path”.
sourcepub fn new_with_json<S: Serialize>(
s: &str,
body: &S
) -> Result<TestRequest, Error>
pub fn new_with_json<S: Serialize>( s: &str, body: &S ) -> Result<TestRequest, Error>
Create a new test request with the method, URL, and body set.
The input string should be in the format “METHOD /path”. The path will automatically be expanded to a full URL: “http://example.com/path”.
Trait Implementations§
source§impl Clone for TestRequest
impl Clone for TestRequest
source§fn clone(&self) -> TestRequest
fn clone(&self) -> TestRequest
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TestRequest
impl Debug for TestRequest
source§impl PartialEq for TestRequest
impl PartialEq for TestRequest
source§fn eq(&self, other: &TestRequest) -> bool
fn eq(&self, other: &TestRequest) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for TestRequest
impl StructuralPartialEq for TestRequest
Auto Trait Implementations§
impl Freeze for TestRequest
impl RefUnwindSafe for TestRequest
impl Send for TestRequest
impl Sync for TestRequest
impl Unpin for TestRequest
impl UnwindSafe 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