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 the “default value” for a type. Read more
Converts this pact to a Value
struct.
Interactions in the Pact
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 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
fn verify_json(
_path: &str,
pact_json: &Value,
strict: bool,
spec_version: PactSpecification
) -> Vec<PactFileVerificationResult>
fn verify_json(
_path: &str,
pact_json: &Value,
strict: bool,
spec_version: PactSpecification
) -> Vec<PactFileVerificationResult>
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
impl RefUnwindSafe for RequestResponsePact
impl Send for RequestResponsePact
impl Sync for RequestResponsePact
impl Unpin for RequestResponsePact
impl UnwindSafe for RequestResponsePact
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more