Struct pact_matching::models::RequestResponseInteraction[][src]

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

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

impl RequestResponseInteraction[src]

pub fn from_json(
    index: usize,
    pact_json: &Value,
    spec_version: &PactSpecification
) -> RequestResponseInteraction
[src]

Constructs an Interaction from the Value struct.

pub fn to_json(&self, spec_version: &PactSpecification) -> Value[src]

Converts this interaction to a Value struct.

pub fn conflicts_with(&self, other: &dyn Interaction) -> Vec<PactConflict>[src]

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

Trait Implementations

impl Clone for RequestResponseInteraction[src]

impl Debug for RequestResponseInteraction[src]

impl Default for RequestResponseInteraction[src]

impl Display for RequestResponseInteraction[src]

impl Eq for RequestResponseInteraction[src]

impl Hash for RequestResponseInteraction[src]

impl Interaction for RequestResponseInteraction[src]

impl PartialEq<RequestResponseInteraction> for RequestResponseInteraction[src]

impl StructuralEq for RequestResponseInteraction[src]

impl StructuralPartialEq for RequestResponseInteraction[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<T> Conv for T

impl<T> Conv for T

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

impl<T> FmtForward for T

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

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> TryConv for T

impl<T> TryConv for T

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<V, T> VZip<V> for T where
    V: MultiLane<T>,