Struct pact_models::v4::pact::V4Pact [−][src]
pub struct V4Pact {
pub consumer: Consumer,
pub provider: Provider,
pub interactions: Vec<Box<dyn V4Interaction>>,
pub metadata: BTreeMap<String, Value>,
pub plugin_data: Vec<PluginData>,
}
Expand description
V4 spec 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<Box<dyn V4Interaction>>
List of messages between the consumer and provider.
metadata: BTreeMap<String, Value>
Metadata associated with this pact.
plugin_data: Vec<PluginData>
Plugin data associated with this pact
Implementations
If this Pact has any interactions of the given type
If this Pact has different types of interactions
pub fn filter_interactions(
&self,
interaction_type: V4InteractionType
) -> Vec<Box<dyn Interaction + Send + Sync>>ⓘ
pub fn filter_interactions(
&self,
interaction_type: V4InteractionType
) -> Vec<Box<dyn Interaction + Send + Sync>>ⓘ
Returns all the interactions of the given type
Trait Implementations
Interactions in the Pact
Converts this pact to a Value
struct.
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
fn plugin_data(&self) -> Vec<PluginData>ⓘ
fn plugin_data(&self) -> Vec<PluginData>ⓘ
Plugins required for this Pact. These will be taken from the ‘plugins’ key in the pact metadata. Read more
Add the plugin and plugin data to this Pact. If an entry already exists for the plugin, the plugin data will be merged Read more
Adds some version info to the Pact-Rust metadata section
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
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 V4Pact
impl !UnwindSafe for V4Pact
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more