Crate pact_ffi

Crate pact_ffi 

Source
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_server module 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 plugins module provides exported functions using C bindings for using plugins with Pact tests.
verifier
The verifier module 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 &str safely with null checks.

Structs§

Mismatches
A collection of mismatches from a matching comparison.
MismatchesIterator
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