Struct ntex::http::client::TestResponse
source · pub struct TestResponse { /* private fields */ }
Expand description
Test ClientResponse
builder
Implementations§
source§impl TestResponse
impl TestResponse
sourcepub fn with_header<K, V>(key: K, value: V) -> Selfwhere
HeaderName: TryFrom<K>,
HeaderValue: TryFrom<V>,
<HeaderName as TryFrom<K>>::Error: Into<HttpError>,
pub fn with_header<K, V>(key: K, value: V) -> Selfwhere
HeaderName: TryFrom<K>,
HeaderValue: TryFrom<V>,
<HeaderName as TryFrom<K>>::Error: Into<HttpError>,
Create TestResponse and set header
sourcepub fn header<K, V>(self, key: K, value: V) -> Selfwhere
HeaderName: TryFrom<K>,
HeaderValue: TryFrom<V>,
<HeaderName as TryFrom<K>>::Error: Into<HttpError>,
pub fn header<K, V>(self, key: K, value: V) -> Selfwhere
HeaderName: TryFrom<K>,
HeaderValue: TryFrom<V>,
<HeaderName as TryFrom<K>>::Error: Into<HttpError>,
Append a header
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 Debug for TestResponse
impl Debug for TestResponse
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 !Freeze for TestResponse
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