pub struct RequestResponseInteraction {
    pub id: Option<String>,
    pub description: String,
    pub provider_states: Vec<ProviderState>,
    pub request: Request,
    pub response: Response,
}
Expand description

Struct that defines an interaction (request and response pair)

Fields

id: Option<String>

Interaction ID. This will only be set if the Pact file was fetched from a Pact Broker

description: String

Description of this interaction. This needs to be unique in the pact file.

provider_states: Vec<ProviderState>

Optional provider states for the interaction. See <https://docs.pact.io/getting_started/provider_states> for more info on provider states.

request: Request

Request of the interaction

response: Response

Response of the interaction

Implementations

Constructs an Interaction from the Value struct.

Converts this interaction to a Value struct.

Returns list of conflicts if this interaction conflicts with the other interaction.

Two interactions conflict if they have the same description and provider state, but they request and responses are not equal

Generate the JSON schema properties for the given Pact specification

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

The type of the interaction

If this is a request/response interaction

Returns the request/response interaction if it is one

If this is a message interaction

Returns the message interaction if it is one

Interaction ID. This will only be set if the Pact file was fetched from a Pact Broker

Description of this interaction. This needs to be unique in the pact file.

Set the Interaction ID

Set the description of this interaction. This needs to be unique in the pact file.

Optional provider states for the interaction. See <https://docs.pact.io/getting_started/provider_states> for more info on provider states. Read more

Mutable Optional provider states for the interaction. See <https://docs.pact.io/getting_started/provider_states> for more info on provider states. Read more

👎 Deprecated since 0.1.0:

Some interactions have multiple contents (like request/response), so it is impossible to know which to return for this method

Body of the response or message

The contents of the part to use for verification. For example, with HTTP interactions, this will be the response body Read more

👎 Deprecated since 0.1.0:

Some interactions have multiple contents (like request/response), so it is impossible to know which to return for this method

Determine the content type of the interaction. If a Content-Type header or metadata value is present, the value of that value will be returned. Otherwise, the contents will be inspected. Read more

If this is a V4 interaction

Returns the interaction in V4 format

Returns a mutable reference for the interaction. If the interaction is not a V4 format, will return None. The as_v4 method can convert to V4 format (via cloning the data). Read more

Returns the interaction in V4 format

Returns the interaction in V4 format

Returns the interaction in V4 format

Returns the interaction in V4 format

Returns the interaction in V4 format

Returns the interaction in V4 format

Clones this interaction and wraps it in a Box

Clones this interaction and wraps it in an Arc

Clones this interaction and wraps it in an Arc and Mutex

👎 Deprecated since 0.2.1:

Some interactions have multiple contents (like request/response), so it is impossible to know which to return for this method

Returns the matching rules associated with this interaction (if there are any)

If the interaction is V4 HTTP

If the interaction is a V4 message

If the interaction is a V4 synchronous request/response message

If this interaction is pending (V4 only)

Verify the JSON format. Will return an error if the list contains any Error result

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Give this value the specified foreground colour

Give this value the specified background colour

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more