Crate pact_models

Source
Expand description

The pact_models crate provides all the structs and traits required to model a Pact.

§Crate features

All features are enabled by default

  • datetime: Enables support of date and time expressions and generators. This will add the chronos crate as a dependency.
  • xml: Enables support for parsing XML documents. This feature will add the sxd-document crate as a dependency.

Modules§

bodies
Module for handling interaction content (bodies)
content_types
Module for handling content types
expression_parser
expression parser for generator expressions
file_utils
Functions for dealing with file locks while reading/writing pact files
generators
generators module includes all the classes to deal with V3/V4 spec generators
headers
http_parts
HTTP parts of a Request/Response interaction
http_utils
Module for fetching documents via HTTP
interaction
Models for Pact interactions
json_utils
Collection of utilities for working with JSON
matchingrules
matchingrules module includes all the classes to deal with V3/V4 spec matchers
message
The message module provides all functionality to deal with message interactions.
message_pact
The message_pact module defines a Pact that contains Messages instead of Interactions.
pact
Traits to represent a Pact
path_exp
Functions for dealing with path expressions
plugins
Models to support plugins
prelude
A “prelude” or a default list of import types to include.
provider_states
provider_states module contains all the logic for dealing with provider states. See https://docs.pact.io/getting_started/provider_states for more info on provider states.
query_strings
request
Structs to model an HTTP request
response
sync_interaction
Models for synchronous request/response interactions
sync_pact
Synchronous HTTP Request/Response Pact
time_utils
Utilities for dealing with time and date values. These are based on the Java DateTimeFormatter
v4
V4 specification models
verify_json
Module for verifying the state of the Pact JSON (file format verification)
xml_utils
Collection of utilities for working with XML

Macros§

generators
Macro to make constructing generators easy Example usage:
matchingrules
Macro to ease constructing matching rules Example usage:
matchingrules_list
Macro to ease constructing matching rules Example usage:

Structs§

Consumer
Struct that defines the consumer of the pact.
Provider
Struct that defines a provider of a pact.

Enums§

DifferenceType
Enumeration of the types of differences between requests and responses
HttpStatus
Enum that defines the different types of HTTP statuses
PactSpecification
Enum defining the pact specification versions supported by the library

Constants§

PACT_RUST_VERSION
Version of the library