Struct pact_matching::models::Pact[][src]

pub struct Pact {
    pub consumer: Consumer,
    pub provider: Provider,
    pub interactions: Vec<Interaction>,
    pub metadata: BTreeMap<String, BTreeMap<String, String>>,
    pub specification_version: PactSpecification,
}

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

Fields

Consumer side of the pact

Provider side of the pact

List of interactions between the consumer and provider.

Metadata associated with this pact file.

Specification version of this pact

Methods

impl Pact
[src]

Returns the specification version of this pact

Creates a Pact from a Value struct.

Converts this pact to a Value struct.

Creates a BTreeMap of the metadata of this pact.

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 any interaction has the same description and provider state and the requests and responses are different.

Determins the default file name for the pact. This is based on the consumer and provider names.

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

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

Writes this pact out to the provided file path. All directories in the path will automatically created. If an existing pact is found at the path, this pact will be merged into the pact file.

Returns a default Pact struct

Trait Implementations

impl Debug for Pact
[src]

Formats the value using the given formatter. Read more

impl Clone for Pact
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Pact

impl Sync for Pact