77 releases (40 stable)

Uses new Rust 2024

new 1.3.1 May 20, 2025
1.3.0 Mar 25, 2025
1.2.6 Dec 11, 2024
1.2.5 Nov 12, 2024
0.1.0 Jul 23, 2021

#232 in Parser implementations

Download history 876/week @ 2025-01-27 887/week @ 2025-02-03 967/week @ 2025-02-10 1061/week @ 2025-02-17 1292/week @ 2025-02-24 1470/week @ 2025-03-03 1627/week @ 2025-03-10 1262/week @ 2025-03-17 1618/week @ 2025-03-24 1034/week @ 2025-03-31 5202/week @ 2025-04-07 1412/week @ 2025-04-14 1243/week @ 2025-04-21 613/week @ 2025-04-28 827/week @ 2025-05-05 1103/week @ 2025-05-12

3,823 downloads per month
Used in 16 crates (14 directly)

MIT license

1MB
24K SLoC

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.

Pact Models

This library provides the core models for dealing with Pact files. It supports the V3 pact specification and V4 pact specification.

Online rust docs

Reading and writing Pact files

The Pact struct has methods to read and write pact JSON files. It supports all the specification versions up to V4, but will convert a V1, V1.1 and V2 spec file to a V3 format.

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.

Dependencies

~9–23MB
~287K SLoC