# Pact-Rust
> Pact implementation written in Rust.
This project provides a Pact implementation written in Rust. It supports the [V3 Pact specification](https://github.com/pact-foundation/pact-specification/tree/version-3)
and [V4 Pact specification](https://github.com/pact-foundation/pact-specification/tree/version-4) and provides shared libraries that can be used in other languages via foreign function interfaces (FFI).
## pact-derive crate
This is currently a placeholder crate
Note: **Versions prior to 0.4.0, contain code which has now migrated
to the [`codas`](https://crates.io/crates/codas) crate.**
## Ecosystem
The ecosystem is built up of multiple different crates, each which serve a different purpose.
All active crates are listed below.
### Core
#### [pact_models](https://github.com/pact-foundation/pact-reference/tree/master/rust/pact_models)
This is a library that provides the Pact models and functions for reading and writing pact files.
#### [pact_matching](https://github.com/pact-foundation/pact-reference/tree/master/rust/pact_matching)
This is a library that provides the Pact functions for matching requests and responses.
#### [pact_mock_server](https://github.com/pact-foundation/pact-core-mock-server/pact_mock_server)
This is a library that implements the in-process mock server for matching HTTP requests and generating responses from a pact file.
It implements the [V3 Pact specification](https://github.com/pact-foundation/pact-specification/tree/version-3)
and [V4 Pact specification](https://github.com/pact-foundation/pact-specification/tree/version-4)
### Library Consumers
#### [pact_consumer](https://github.com/pact-foundation/pact-reference/tree/master/rust/pact_consumer)
This is a library that provides the Pact consumer test support and DSL for use in Rust projects.
#### [pact_verifier](https://github.com/pact-foundation/pact-reference/tree/master/rust/pact_verifier)
This library provides support for verifying a provider against pact files.
### External Consumers
#### FFI
##### [pact_ffi](https://github.com/pact-foundation/pact-reference/tree/master/rust/pact_ffi)
This is a library that implements exported functions using C bindings for use in foreign languages.
#### CLI
##### [pact_mock_server_cli](https://github.com/pact-foundation/pact-core-mock-server/pact_mock_server_cli)
A command line application that provides both a restful web api and command line interface to run pact mock servers and is able to manage multiple mock servers. The lifecycle of each mock server can be controlled by the
restful web api or through the command line interface. It implements the [V4 Pact specification](https://github.com/pact-foundation/pact-specification/tree/version-4).
##### [pact_verifier_cli](https://github.com/pact-foundation/pact-reference/tree/master/rust/pact_verifier_cli)
Command line executable that uses the [pact_verifier](https://github.com/pact-foundation/pact-reference/tree/master/rust/pact_verifier) to be able to verify a running provider against pact files.
### Plugins
#### [pact-plugin-driver](https://github.com/pact-foundation/pact-plugins/tree/main/drivers/rust/driver)
A support library that provides an interface for interacting with Pact plugins
#### [pact-plugin-cli](https://github.com/pact-foundation/pact-plugins/tree/main/cli)
Command line executable to manage and install Pact plugins.
### Satellite
#### [pact-stub-server](https://github.com/pact-foundation/pact-stub-server)
Command line executable that provides a server that can generate responses based on pact files. It implements the V4 Pact specification.
## Contributing
See [CONTRIBUTING](../CONTRIBUTING.md) (PRs are always welcome!).
## Documentation
Rust crate documentation is published to the Rust documentation site.
* [pact_matching](https://docs.rs/pact_matching/)
* [pact_models](https://docs.rs/pact_models/)
* [pact_mock_server](https://docs.rs/pact_mock_server)
* [pact_consumer](https://docs.rs/pact_consumer/)
* [pact_verifier](https://docs.rs/pact_verifier/)
* [pact_ffi](https://docs.rs/pact_ffi/)
* [pact_mock_server_cli](https://docs.rs/pact_mock_server_cli)
* [pact_verifier_cli](https://docs.rs/pact_verifier_cli/)
* [pact-plugin-driver](https://docs.rs/pact-plugin-driver)
* [pact-plugin-cli](https://docs.rs/pact-plugin-cli)
* [pact-stub-server](https://docs.rs/pact-stub-server)
Additional documentation can be found at the main [Pact website](https://pact.io).
## Contact
Join us in slack: [](https://slack.pact.io)
or
- Twitter: [@pact_up](https://twitter.com/pact_up)
- Stack Overflow: [stackoverflow.com/questions/tagged/pact](https://stackoverflow.com/questions/tagged/pact)
## Licensing
The code in this project is licensed under a MIT license. See [LICENSE](../LICENSE).