pub struct HttpResponse {
pub status_code: Option<u16>,
pub headers: Option<HashMap<String, Vec<String>>>,
pub body: Option<String>,
pub delay: Option<Delay>,
}Expand description
Builder for an HTTP response action.
§Example
use mockserver_client::HttpResponse;
let response = HttpResponse::new()
.status_code(201)
.header("Location", "/api/users/42")
.body("{\"id\": 42}");Fields§
§status_code: Option<u16>§headers: Option<HashMap<String, Vec<String>>>§body: Option<String>§delay: Option<Delay>Implementations§
Trait Implementations§
Source§impl Clone for HttpResponse
impl Clone for HttpResponse
Source§fn clone(&self) -> HttpResponse
fn clone(&self) -> HttpResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 HttpResponse
impl Debug for HttpResponse
Source§impl Default for HttpResponse
impl Default for HttpResponse
Source§fn default() -> HttpResponse
fn default() -> HttpResponse
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for HttpResponse
impl<'de> Deserialize<'de> for HttpResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for HttpResponse
impl PartialEq for HttpResponse
Source§fn eq(&self, other: &HttpResponse) -> bool
fn eq(&self, other: &HttpResponse) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for HttpResponse
impl Serialize for HttpResponse
impl StructuralPartialEq for HttpResponse
Auto Trait Implementations§
impl Freeze for HttpResponse
impl RefUnwindSafe for HttpResponse
impl Send for HttpResponse
impl Sync for HttpResponse
impl Unpin for HttpResponse
impl UnsafeUnpin for HttpResponse
impl UnwindSafe for HttpResponse
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