Skip to content

pact-foundation/pact-reference

Repository files navigation

Logo of the project

Pact-Rust Build Pact-Rust FFI Build

Pact Reference Implementation

Reference implementations for the Pact Specification written in Rust

This project contains a reference implementation of the Pact specification written in Rust, often referred to as the Pact Core.

It exposes the core functionality through various crates, as part of the Pact Rust SDK, as well as through FFI (Foreign Function Interface) and CLI (Command Line Interface) for use in other programming languages.

Usage

Rust

For Rust projects, you can use the Rust crates from this library in your project directly. Refer to the Rust project readme.

FFI

This project contains dynamic libraries that expose the core functionality through a C-compatible FFI (Foreign Function Interface).

This project contains a couple of examples which demonstrate how to use the FFI library in a C project, with a focus on showcasing how to call the FFI functions from C:

Most of the Pact SDKs in other languages make use of this FFI library to provide Pact functionality. You can see this in the Ecosystem graph, and the following examples:

Lastly, you can also refer to Hello Pact FFI for collection of examples in various languages.

CLI

This project contains code to support exposing the core functionality through CLI (Command Line Interface).

They are distributed in binary & Docker formats.

Building

To build the libraries in this project, you need a working Rust environment. Requires minimum Rust 1.59.0. Refer to the Rust Guide.

The build tool used is cargo.

cd rust
cargo build

This will compile all the libraries and put the generated files in rust/target/debug.

Contributing

See CONTRIBUTING (PRs are always welcome!).

Documentation

Rust library documentation is published to the Rust documentation site docs.rs. Refer to the Rust project README.

Additional documentation can be found at the main Pact website.

Contact

Join us in slack: slack

or

Licensing

The code in this project is licensed under a MIT license. See LICENSE.

About

Reference implementations for the pact specifications

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors 35