[][src]Struct pact_matching::models::Response

pub struct Response {
    pub status: u16,
    pub headers: Option<HashMap<String, Vec<String>>>,
    pub body: OptionalBody,
    pub matching_rules: MatchingRules,
    pub generators: Generators,
}

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

Implementations

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]

👎 Deprecated since 0.5.4:

please use default() from the standard Default trait instead

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]

Return a description of all the differences from the other response

Trait Implementations

impl Clone for Response[src]

impl Debug for Response[src]

impl Default for Response[src]

impl Display for Response[src]

impl Eq for Response[src]

impl Hash for Response[src]

impl HttpPart for Response[src]

impl PartialEq<Response> for Response[src]

impl StructuralEq for Response[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any