76 releases (39 stable)

Uses new Rust 2024

1.3.0 Mar 25, 2025
1.2.6 Dec 11, 2024
1.2.5 Nov 12, 2024
1.2.2 Jul 17, 2024
0.1.0 Jul 23, 2021

#165 in Parser implementations

Download history 884/week @ 2025-01-09 965/week @ 2025-01-16 975/week @ 2025-01-23 854/week @ 2025-01-30 965/week @ 2025-02-06 950/week @ 2025-02-13 1151/week @ 2025-02-20 1397/week @ 2025-02-27 1420/week @ 2025-03-06 1870/week @ 2025-03-13 1424/week @ 2025-03-20 1034/week @ 2025-03-27 5090/week @ 2025-04-03 1447/week @ 2025-04-10 1260/week @ 2025-04-17 990/week @ 2025-04-24

8,951 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

~10–23MB
~291K SLoC