[][src]Trait pact_matching::models::Interaction

pub trait Interaction {
    fn type_of(&self) -> String;
fn is_request_response(&self) -> bool;
fn as_request_response(&self) -> Option<RequestResponseInteraction>;
fn is_message(&self) -> bool;
fn as_message(&self) -> Option<Message>;
fn id(&self) -> Option<String>;
fn description(&self) -> String;
fn provider_states(&self) -> Vec<ProviderState>;
fn contents(&self) -> OptionalBody;
fn content_type(&self) -> Option<ContentType>; }

Interaction Trait

Required methods

fn type_of(&self) -> String

The type of the interaction

fn is_request_response(&self) -> bool

If this is a request/response interaction

fn as_request_response(&self) -> Option<RequestResponseInteraction>

Returns the request/response interaction if it is one

fn is_message(&self) -> bool

If this is a message interaction

fn as_message(&self) -> Option<Message>

Returns the message interaction if it is one

fn id(&self) -> Option<String>

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

fn description(&self) -> String

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

fn provider_states(&self) -> Vec<ProviderState>

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

fn contents(&self) -> OptionalBody

Body of the response or message

fn content_type(&self) -> Option<ContentType>

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.

Loading content...

Trait Implementations

impl Debug for dyn Interaction[src]

impl Display for dyn Interaction[src]

Implementors

Loading content...