[][src]Struct pact_matching::models::Interaction

pub struct Interaction {
    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

Methods

impl Interaction[src]

pub fn from_json(
    index: usize,
    pact_json: &Value,
    spec_version: &PactSpecification
) -> Interaction
[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: &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 Interaction[src]

impl Debug for Interaction[src]

impl Default for Interaction[src]

impl Display for Interaction[src]

impl Eq for Interaction[src]

impl Hash for Interaction[src]

impl PartialEq<Interaction> for Interaction[src]

impl StructuralEq for Interaction[src]

impl StructuralPartialEq for Interaction[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.