[−][src]Struct pact_matching::models::Response
Struct that defines the response.
Fields
status: u16
Response status
headers: Option<HashMap<String, Vec<String>>>
Response headers
body: OptionalBody
Response body
matching_rules: MatchingRules
Response matching rules
generators: Generators
Response generators
Methods
impl Response
[src]
pub fn from_json(response: &Value, _: &PactSpecification) -> Response
[src]
Build a Response
from a Value
struct.
pub fn default_response() -> Response
[src]
Returns a default response: Status 200
pub fn to_json(&self, spec_version: &PactSpecification) -> Value
[src]
Converts this response to a Value
struct.
pub fn differences_from(
&self,
other: &Response
) -> Vec<(DifferenceType, String)>
[src]
&self,
other: &Response
) -> Vec<(DifferenceType, String)>
Return a description of all the differences from the other response
Trait Implementations
impl HttpPart for Response
[src]
fn headers(&self) -> &Option<HashMap<String, Vec<String>>>
[src]
fn body(&self) -> &OptionalBody
[src]
fn matching_rules(&self) -> &MatchingRules
[src]
fn generators(&self) -> &Generators
[src]
fn content_type(&self) -> String
[src]
Determine the content type of the HTTP part. If a Content-Type
header is present, the value of that header will be returned. Otherwise, the body will be inspected. Read more
fn detect_content_type(&self) -> String
[src]
Tries to detect the content type of the body by matching some regular expressions against the first 32 characters. Default to text/plain
if no match is found. Read more
fn content_type_enum(&self) -> DetectedContentType
[src]
Returns the general content type (ignoring subtypes)
fn has_header(&self, header_name: &String) -> bool
[src]
Checks if the HTTP Part has the given header
fn lookup_header_value(&self, header_name: &String) -> Option<String>
[src]
Checks if the HTTP Part has the given header
impl Clone for Response
[src]
fn clone(&self) -> Response
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<Response> for Response
[src]
impl Eq for Response
[src]
impl Display for Response
[src]
impl Debug for Response
[src]
impl Hash for Response
[src]
Auto Trait Implementations
impl Sync for Response
impl Send for Response
impl Unpin for Response
impl RefUnwindSafe for Response
impl UnwindSafe for Response
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,