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

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>;
fn is_v4(&self) -> bool;
fn as_v4(&self) -> V4Interaction;
fn boxed(&self) -> Box<dyn Interaction>;
fn arced(&self) -> Arc<dyn Interaction>;
fn thread_safe(&self) -> Arc<Mutex<dyn Interaction + Send + Sync>>; }

Interaction Trait

Required methods

fn type_of(&self) -> String[src]

The type of the interaction

fn is_request_response(&self) -> bool[src]

If this is a request/response interaction

fn as_request_response(&self) -> Option<RequestResponseInteraction>[src]

Returns the request/response interaction if it is one

fn is_message(&self) -> bool[src]

If this is a message interaction

fn as_message(&self) -> Option<Message>[src]

Returns the message interaction if it is one

fn id(&self) -> Option<String>[src]

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

fn description(&self) -> String[src]

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

fn provider_states(&self) -> Vec<ProviderState>[src]

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[src]

Body of the response or message

fn content_type(&self) -> Option<ContentType>[src]

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.

fn is_v4(&self) -> bool[src]

If this is a V4 interaction

fn as_v4(&self) -> V4Interaction[src]

Returns the interaction in V4 format

fn boxed(&self) -> Box<dyn Interaction>[src]

Clones this interaction and wraps it in a Box

fn arced(&self) -> Arc<dyn Interaction>[src]

Clones this interaction and wraps it in an Arc

fn thread_safe(&self) -> Arc<Mutex<dyn Interaction + Send + Sync>>[src]

Clones this interaction and wraps it in an Arc and Mutex

Loading content...

Trait Implementations

impl Debug for dyn Interaction[src]

impl Display for dyn Interaction[src]

Implementors

impl Interaction for V4Interaction[src]

impl Interaction for Message[src]

impl Interaction for RequestResponseInteraction[src]

Loading content...