Expand description
A crate exposing the pact APIs to other languages
via a C Foreign Function Interface.
Modules§
- error
- Tools for FFI error reporting and handling.
- log
- Sets up a log sink to view logs from the FFI.
- matching
- Module provides FFI functions to match values using Pact matching rules
- mock_
server - The
mock_servermodule provides a number of exported functions using C bindings for controlling a mock server. These can be used in any language that supports C bindings. - models
- FFI functions to support Pact models.
- plugins
- The
pluginsmodule provides exported functions using C bindings for using plugins with Pact tests. - verifier
- The
verifiermodule provides a number of exported functions using C bindings for controlling the pact verification process. These can be used in any language that supports C bindings.
Macros§
- as_mut
- Get a mutable reference from a raw pointer
- as_ref
- Get an immutable reference from a raw pointer
- cstr
- Construct a CStr safely with null checks.
- safe_
str - Construct a
&strsafely with null checks.
Structs§
- Mismatches
- A collection of mismatches from a matching comparison.
- Mismatches
Iterator - An iterator over mismatches.
Enums§
- Mismatch
- Enum that defines the different types of mismatches that can occur.
Functions§
- pactffi_
enable_ ansi_ support - Enable ANSI coloured output on Windows. On non-Windows platforms, this function is a no-op.
- pactffi_
init ⚠ - Initialise the mock server library, can provide an environment variable name to use to set the log levels. This function should only be called once, as it tries to install a global tracing subscriber.
- pactffi_
init_ ⚠with_ log_ level - Initialises logging, and sets the log level explicitly. This function should only be called once, as it tries to install a global tracing subscriber.
- pactffi_
log_ ⚠message - Log using the shared core logging facility.
- pactffi_
match_ message - Match a pair of messages, producing a collection of mismatches, which is empty if the two messages matched.
- pactffi_
mismatch_ ansi_ description - Get an ANSI-compatible description of a mismatch.
- pactffi_
mismatch_ description - Get a description of a mismatch.
- pactffi_
mismatch_ summary - Get a summary of a mismatch.
- pactffi_
mismatch_ to_ json - Get a JSON representation of the mismatch.
- pactffi_
mismatch_ type - Get the type of a mismatch.
- pactffi_
mismatches_ delete - Delete mismatches
- pactffi_
mismatches_ get_ iter - Get an iterator over mismatches.
- pactffi_
mismatches_ iter_ delete - Delete a mismatches iterator when you’re done with it.
- pactffi_
mismatches_ iter_ next - Get the next mismatch from a mismatches iterator.
- pactffi_
version - Returns the current library version