Struct awc::test::TestResponse
source · pub struct TestResponse { /* private fields */ }
Expand description
Test ClientResponse
builder
Implementations§
source§impl TestResponse
impl TestResponse
sourcepub fn with_header(header: impl TryIntoHeaderPair) -> Self
pub fn with_header(header: impl TryIntoHeaderPair) -> Self
Create TestResponse and set header
sourcepub fn insert_header(self, header: impl TryIntoHeaderPair) -> Self
pub fn insert_header(self, header: impl TryIntoHeaderPair) -> Self
Insert a header
sourcepub fn append_header(self, header: impl TryIntoHeaderPair) -> Self
pub fn append_header(self, header: impl TryIntoHeaderPair) -> Self
Append a header
Available on crate feature cookies
only.
cookies
only.Set cookie for this response
sourcepub fn set_payload<B: Into<Bytes>>(self, data: B) -> Self
pub fn set_payload<B: Into<Bytes>>(self, data: B) -> Self
Set response’s payload
sourcepub fn finish(self) -> ClientResponse
pub fn finish(self) -> ClientResponse
Complete response creation and generate ClientResponse
instance
Trait Implementations§
source§impl Default for TestResponse
impl Default for TestResponse
source§fn default() -> TestResponse
fn default() -> TestResponse
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for TestResponse
impl !Send for TestResponse
impl !Sync for TestResponse
impl Unpin for TestResponse
impl !UnwindSafe for TestResponse
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