Struct pact_models::sync_pact::RequestResponsePact[][src]

pub struct RequestResponsePact {
    pub consumer: Consumer,
    pub provider: Provider,
    pub interactions: Vec<RequestResponseInteraction>,
    pub metadata: BTreeMap<String, BTreeMap<String, String>>,
    pub specification_version: PactSpecification,
}
Expand description

Struct that represents a pact between the consumer and provider of a service.

Fields

consumer: Consumer

Consumer side of the pact

provider: Provider

Provider side of the pact

interactions: Vec<RequestResponseInteraction>

List of interactions between the consumer and provider.

metadata: BTreeMap<String, BTreeMap<String, String>>

Metadata associated with this pact file.

specification_version: PactSpecification

Specification version of this pact

Implementations

Returns the specification version of this pact

Creates a Pact from a Value struct.

Creates a BTreeMap of the metadata of this pact.

Reads the pact file from a URL and parses the resulting JSON into a Pact struct

Returns a default RequestResponsePact struct

Returns the default metadata

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

Converts this pact to a Value struct.

Consumer side of the pact

Provider side of the pact

Interactions in the Pact

Pact metadata

Attempt to downcast to a concrete Pact

Attempt to downcast to a concrete Message Pact

Attempt to downcast to a concrete V4 Pact

Specification version of this Pact

Clones this Pact and wraps it in a Box

Clones this Pact and wraps it in an Arc

Clones this Pact and wraps it in an Arc and Mutex

Adds an interactions in the Pact

If this Pact needs any plugins loaded

Plugins required for this Pact. These will be taken from the ‘plugins’ key in the pact metadata. Read more

If this is a V4 Pact

Add the plugin to this Pact

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 !=.

Reads the pact file and parses the resulting JSON into a Pact struct

Merges this pact with the other pact, and returns a new Pact with the interactions sorted. Returns an error if there is a merge conflict, which will occur if the other pact is a different type, or if a V3 Pact then if any interaction has the same description and provider state and the requests and responses are different. Read more

Determines the default file name for the pact. This is based on the consumer and provider names. Read more

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

Performs the conversion.

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

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. 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.