From 2dec0e225ac78b2eed4384479831eac885701079 Mon Sep 17 00:00:00 2001 From: JP-Ellis Date: Thu, 15 Oct 2026 12:37:22 +1100 Subject: [PATCH 1/3] feat: update bindings to Pact FFI 0.5.10 Add wrappers for the functions introduced in 0.5.9 and 0.5.10: - `register_log_callback`, with the `LogCallback` alias, forwards every log event from the Pact libraries to a Python callable. - `set_log_callback_level` sets the most verbose level forwarded to that callback. The default is `OFF`. - `sync_message_generate_contents` returns a synchronous message with its generators applied, parsed from the V4 JSON. The header emits the `pactffi_register_log_callback` parameter as an opaque struct passed by value, the same defect as the plugin log callback (pact-reference#544). The build hook now patches both into function pointers. 0.5.9 changed the plugin log behaviour. Registering a plugin log callback, or applying a logger through `logger_apply` or `log_to_*`, now installs the plugin log sink. A `NULL` registration now deregisters the callback. The plugin log docstrings describe this, and deregistering releases the reference to the CFFI callback. All upstream documentation links now point at 0.5.10. Signed-off-by: JP-Ellis Assisted-by: Claude Code:claude-opus-5-5 --- pact-python-ffi/hatch_build.py | 57 +- pact-python-ffi/src/pact_ffi/__init__.py | 664 ++++++++++++++--------- pact-python-ffi/tests/test_init.py | 69 +++ 3 files changed, 501 insertions(+), 289 deletions(-) diff --git a/pact-python-ffi/hatch_build.py b/pact-python-ffi/hatch_build.py index f7616e985..bc68fe569 100644 --- a/pact-python-ffi/hatch_build.py +++ b/pact-python-ffi/hatch_build.py @@ -386,37 +386,46 @@ def _patch_header(self, source: str) -> str: """ Patch the upstream header so that CFFI can compile it. - The upstream `pact.h` emits the callback parameter of - `pactffi_register_plugin_log_callback` as an opaque struct passed by - value, which cannot be compiled. The Rust signature is - `Option`, whose ABI is a nullable function pointer. - See https://github.com/pact-foundation/pact-reference/issues/544. + The upstream `pact.h` emits the callback parameters of + `pactffi_register_plugin_log_callback` and + `pactffi_register_log_callback` as opaque structs passed by value, which + cannot be compiled. The Rust signatures are `Option`, + whose ABI is a nullable function pointer. See + https://github.com/pact-foundation/pact-reference/issues/544. Args: source: The contents of the upstream `pact.h`. Returns: - The header contents with the callback declared as a function - pointer. + The header contents with the callbacks declared as function + pointers. """ - opaque = "typedef struct Option_PluginLogCallback Option_PluginLogCallback;" - if opaque not in source: - return source - self.app.display_debug("Patching Option_PluginLogCallback in pact.h") - return source.replace( - opaque, - "typedef void (*PluginLogCallback)(" - "const char *plugin_instance_id, " - "const char *test_run_id, " - "const char *level, " - "const char *target, " - "const char *message);", - ).replace( - "void pactffi_register_plugin_log_callback(" - "struct Option_PluginLogCallback callback);", - "void pactffi_register_plugin_log_callback(PluginLogCallback callback);", - ) + for callback, register, first_arg in ( + ( + "PluginLogCallback", + "pactffi_register_plugin_log_callback", + "plugin_instance_id", + ), + ("LogCallback", "pactffi_register_log_callback", "log_id"), + ): + opaque = f"typedef struct Option_{callback} Option_{callback};" + if opaque not in source: + continue + self.app.display_debug(f"Patching Option_{callback} in pact.h") + source = source.replace( + opaque, + f"typedef void (*{callback})(" + f"const char *{first_arg}, " + "const char *test_run_id, " + "const char *level, " + "const char *target, " + "const char *message);", + ).replace( + f"void {register}(struct Option_{callback} callback);", + f"void {register}({callback} callback);", + ) + return source def _download(self, url: str) -> Path: """ diff --git a/pact-python-ffi/src/pact_ffi/__init__.py b/pact-python-ffi/src/pact_ffi/__init__.py index 96b125442..bc885810c 100644 --- a/pact-python-ffi/src/pact_ffi/__init__.py +++ b/pact-python-ffi/src/pact_ffi/__init__.py @@ -154,6 +154,16 @@ empty strings when not known. """ +LogCallback = Callable[[str, str, str, str, str], None] +""" +Callback invoked for each log event emitted by the Pact libraries. + +The arguments are, in order, the log ID, the test run ID, the log level, the log +target, and the log message. The log ID is the mock server ID while handling a +mock server request, or `verify:` while verifying a provider. +Missing values are passed as empty strings. +""" + ################################################################################ # Classes ################################################################################ @@ -429,7 +439,7 @@ class InteractionHandle: Handle to a HTTP Interaction. [Rust - `InteractionHandle`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/struct.InteractionHandle.html) + `InteractionHandle`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/struct.InteractionHandle.html) """ def __init__(self, ref: int) -> None: @@ -929,7 +939,7 @@ class PactHandle: Handle to a Pact. [Rust - `PactHandle`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/struct.PactHandle.html) + `PactHandle`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/struct.PactHandle.html) """ def __init__(self, ref: int) -> None: @@ -1712,7 +1722,7 @@ class VerifierHandle: """ Handle to a Verifier. - [Rust `VerifierHandle`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/handle/struct.VerifierHandle.html) + [Rust `VerifierHandle`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/handle/struct.VerifierHandle.html) """ def __init__(self, ref: cffi.FFI.CData) -> None: @@ -1748,7 +1758,7 @@ class ExpressionValueType(Enum): """ Expression Value Type. - [Rust `ExpressionValueType`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/expressions/enum.ExpressionValueType.html) + [Rust `ExpressionValueType`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/expressions/enum.ExpressionValueType.html) """ UNKNOWN = lib.ExpressionValueType_Unknown @@ -1775,7 +1785,7 @@ class GeneratorCategory(Enum): """ Generator Category. - [Rust `GeneratorCategory`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/generators/enum.GeneratorCategory.html) + [Rust `GeneratorCategory`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/generators/enum.GeneratorCategory.html) """ METHOD = lib.GeneratorCategory_METHOD @@ -1803,7 +1813,7 @@ class InteractionPart(Enum): """ Interaction Part. - [Rust `InteractionPart`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/enum.InteractionPart.html) + [Rust `InteractionPart`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/enum.InteractionPart.html) """ REQUEST = lib.InteractionPart_Request @@ -1849,7 +1859,7 @@ class MatchingRuleCategory(Enum): """ Matching Rule Category. - [Rust `MatchingRuleCategory`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/matching_rules/enum.MatchingRuleCategory.html) + [Rust `MatchingRuleCategory`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/matching_rules/enum.MatchingRuleCategory.html) """ METHOD = lib.MatchingRuleCategory_METHOD @@ -1878,7 +1888,7 @@ class PactSpecification(Enum): """ Pact Specification. - [Rust `PactSpecification`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/pact_specification/enum.PactSpecification.html) + [Rust `PactSpecification`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/pact_specification/enum.PactSpecification.html) """ UNKNOWN = lib.PactSpecification_Unknown @@ -1931,7 +1941,7 @@ class _StringResult(Enum): """ Internal enum from Pact FFI. - [Rust `StringResult`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/enum.StringResult.html) + [Rust `StringResult`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/enum.StringResult.html) """ FAILED = lib.StringResult_Failed @@ -2096,7 +2106,7 @@ def version() -> str: """ Return the version of the pact_ffi library. - [Rust `pactffi_version`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/fn.pactffi_version.html) + [Rust `pactffi_version`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_version.html) Returns: The version of the pact_ffi library as a string, in the form of `x.y.z`. @@ -2119,7 +2129,7 @@ def init(log_env_var: str) -> None: and [`get_plugin_logs`][pact_ffi.get_plugin_logs]. [Rust - `pactffi_init`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/fn.pactffi_init.html) + `pactffi_init`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_init.html) Args: log_env_var: @@ -2139,7 +2149,7 @@ def init_with_log_level(level: str = "INFO") -> None: and [`get_plugin_logs`][pact_ffi.get_plugin_logs]. [Rust - `pactffi_init_with_log_level`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/fn.pactffi_init_with_log_level.html) + `pactffi_init_with_log_level`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_init_with_log_level.html) Args: level: @@ -2155,7 +2165,7 @@ def enable_ansi_support() -> None: On non-Windows platforms, this function is a no-op. [Rust - `pactffi_enable_ansi_support`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/fn.pactffi_enable_ansi_support.html) + `pactffi_enable_ansi_support`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_enable_ansi_support.html) # Safety @@ -2173,7 +2183,7 @@ def log_message( Log using the shared core logging facility. [Rust - `pactffi_log_message`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/fn.pactffi_log_message.html) + `pactffi_log_message`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_log_message.html) This is useful for callers to have a single set of logs. @@ -2203,7 +2213,7 @@ def mismatches_get_iter(mismatches: Mismatches) -> MismatchesIterator: Get an iterator over mismatches. [Rust - `pactffi_mismatches_get_iter`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/fn.pactffi_mismatches_get_iter.html) + `pactffi_mismatches_get_iter`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_mismatches_get_iter.html) """ raise NotImplementedError @@ -2212,7 +2222,7 @@ def mismatches_delete(mismatches: Mismatches) -> None: """ Delete mismatches. - [Rust `pactffi_mismatches_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/fn.pactffi_mismatches_delete.html) + [Rust `pactffi_mismatches_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_mismatches_delete.html) """ raise NotImplementedError @@ -2221,7 +2231,7 @@ def mismatches_iter_next(iter: MismatchesIterator) -> Mismatch: """ Get the next mismatch from a mismatches iterator. - [Rust `pactffi_mismatches_iter_next`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/fn.pactffi_mismatches_iter_next.html) + [Rust `pactffi_mismatches_iter_next`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_mismatches_iter_next.html) Returns a null pointer if no mismatches remain. """ @@ -2232,7 +2242,7 @@ def mismatches_iter_delete(iter: MismatchesIterator) -> None: """ Delete a mismatches iterator when you're done with it. - [Rust `pactffi_mismatches_iter_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/fn.pactffi_mismatches_iter_delete.html) + [Rust `pactffi_mismatches_iter_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_mismatches_iter_delete.html) """ raise NotImplementedError @@ -2241,7 +2251,7 @@ def mismatch_to_json(mismatch: Mismatch) -> str: """ Get a JSON representation of the mismatch. - [Rust `pactffi_mismatch_to_json`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/fn.pactffi_mismatch_to_json.html) + [Rust `pactffi_mismatch_to_json`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_mismatch_to_json.html) """ raise NotImplementedError @@ -2250,7 +2260,7 @@ def mismatch_type(mismatch: Mismatch) -> str: """ Get the type of a mismatch. - [Rust `pactffi_mismatch_type`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/fn.pactffi_mismatch_type.html) + [Rust `pactffi_mismatch_type`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_mismatch_type.html) """ raise NotImplementedError @@ -2259,7 +2269,7 @@ def mismatch_summary(mismatch: Mismatch) -> str: """ Get a summary of a mismatch. - [Rust `pactffi_mismatch_summary`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/fn.pactffi_mismatch_summary.html) + [Rust `pactffi_mismatch_summary`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_mismatch_summary.html) """ raise NotImplementedError @@ -2268,7 +2278,7 @@ def mismatch_description(mismatch: Mismatch) -> str: """ Get a description of a mismatch. - [Rust `pactffi_mismatch_description`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/fn.pactffi_mismatch_description.html) + [Rust `pactffi_mismatch_description`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_mismatch_description.html) """ raise NotImplementedError @@ -2277,7 +2287,7 @@ def mismatch_ansi_description(mismatch: Mismatch) -> str: """ Get an ANSI-compatible description of a mismatch. - [Rust `pactffi_mismatch_ansi_description`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/fn.pactffi_mismatch_ansi_description.html) + [Rust `pactffi_mismatch_ansi_description`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_mismatch_ansi_description.html) """ raise NotImplementedError @@ -2287,7 +2297,7 @@ def get_error_message(length: int = 1024) -> str | None: Provide the error message from `LAST_ERROR` to the calling C code. [Rust - `pactffi_get_error_message`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/error/ffi/fn.pactffi_get_error_message.html) + `pactffi_get_error_message`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/error/ffi/fn.pactffi_get_error_message.html) This function should be called after any other function in the pact_matching FFI indicates a failure with its own error message, if the caller wants to @@ -2345,7 +2355,7 @@ def log_to_stdout(level_filter: LevelFilter) -> int: [`logger_attach_sink`] with the appropriate sink specifier, and then [`logger_apply`]. - [Rust `pactffi_log_to_stdout`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/log/ffi/fn.pactffi_log_to_stdout.html) + [Rust `pactffi_log_to_stdout`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/log/ffi/fn.pactffi_log_to_stdout.html) """ raise NotImplementedError @@ -2359,7 +2369,7 @@ def log_to_stderr(level_filter: LevelFilter | str = LevelFilter.ERROR) -> None: [`logger_apply`]. [Rust - `pactffi_log_to_stderr`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/log/ffi/fn.pactffi_log_to_stderr.html) + `pactffi_log_to_stderr`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/log/ffi/fn.pactffi_log_to_stderr.html) Args: level_filter: @@ -2388,7 +2398,7 @@ def log_to_file(file_name: str, level_filter: LevelFilter) -> int: [`logger_apply`]. [Rust - `pactffi_log_to_file`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/log/ffi/fn.pactffi_log_to_file.html) + `pactffi_log_to_file`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/log/ffi/fn.pactffi_log_to_file.html) # Safety @@ -2406,7 +2416,7 @@ def log_to_buffer(level_filter: LevelFilter | str = LevelFilter.ERROR) -> None: [`logger_attach_sink`] with the appropriate sink specifier, and then [`logger_apply`]. - [Rust `pactffi_log_to_buffer`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/log/ffi/fn.pactffi_log_to_buffer.html) + [Rust `pactffi_log_to_buffer`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/log/ffi/fn.pactffi_log_to_buffer.html) Raises: RuntimeError: @@ -2424,7 +2434,7 @@ def logger_init() -> None: """ Initialize the FFI logger with no sinks. - [Rust `pactffi_logger_init`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/log/ffi/fn.pactffi_logger_init.html) + [Rust `pactffi_logger_init`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/log/ffi/fn.pactffi_logger_init.html) This initialized logger does nothing until `pactffi_logger_apply` has been called. @@ -2446,7 +2456,7 @@ def logger_attach_sink(sink_specifier: str, level_filter: LevelFilter) -> int: Attach an additional sink to the thread-local logger. [Rust - `pactffi_logger_attach_sink`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/log/ffi/fn.pactffi_logger_attach_sink.html) + `pactffi_logger_attach_sink`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/log/ffi/fn.pactffi_logger_attach_sink.html) This logger does nothing until `pactffi_logger_apply` has been called. @@ -2493,23 +2503,117 @@ def logger_apply() -> int: Apply the previously configured sinks and levels to the program. [Rust - `pactffi_logger_apply`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/log/ffi/fn.pactffi_logger_apply.html) + `pactffi_logger_apply`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/log/ffi/fn.pactffi_logger_apply.html) If no sinks have been setup, will set the log level to info and the target to standard out. This function will install a global tracing subscriber. Any attempts to - modify the logger after the call to `logger_apply` will fail. + modify the logger after the call to `logger_apply` will fail. It also + installs the sink which delivers plugin log entries to + [`register_plugin_log_callback`][pact_ffi.register_plugin_log_callback] + and [`get_plugin_logs`][pact_ffi.get_plugin_logs]. """ raise NotImplementedError +# The CFFI callback must outlive the registration, as the Pact library holds a +# raw function pointer to it. +_log_callback: Callable[..., None] | None = None + + +def register_log_callback(callback: LogCallback | None) -> None: + """ + Register a callback to be invoked for each log event. + + The callback receives every log event emitted by the Pact libraries at or + below the level set with + [`set_log_callback_level`][pact_ffi.set_log_callback_level], which + defaults to [`LevelFilter.OFF`][pact_ffi.LevelFilter.OFF]. Events are only + forwarded once a logger has been applied, with + [`init`][pact_ffi.init], [`init_with_log_level`][pact_ffi.init_with_log_level] + or one of the `log_to_*` functions. + + The callback is invoked on the thread which emitted the event, which may be + a runtime worker thread, so it must be thread-safe. It must not call back + into the Pact FFI, and must not raise. + + Registering a new callback replaces any previously registered one. + + [Rust + `pactffi_register_log_callback`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/log/ffi/fn.pactffi_register_log_callback.html) + + Args: + callback: + The callback to invoke, or `None` to deregister the current + callback. + """ + global _log_callback # noqa: PLW0603 + + if callback is None: + lib.pactffi_register_log_callback(ffi.NULL) + _log_callback = None + return + + def _decode(ptr: cffi.FFI.CData) -> str: + s = ffi.string(ptr) + return s if isinstance(s, str) else s.decode("utf-8") + + def _callback( + log_id: cffi.FFI.CData, + test_run_id: cffi.FFI.CData, + level: cffi.FFI.CData, + target: cffi.FFI.CData, + message: cffi.FFI.CData, + ) -> None: + callback( + _decode(log_id), + _decode(test_run_id), + _decode(level), + _decode(target), + _decode(message), + ) + + new_callback = ffi.callback("LogCallback", _callback) + lib.pactffi_register_log_callback(new_callback) + _log_callback = new_callback + + +def set_log_callback_level(level_filter: LevelFilter | str) -> None: + """ + Set the most verbose level forwarded to the log callback. + + The level applies to the callback registered with + [`register_log_callback`][pact_ffi.register_log_callback], and defaults + to [`LevelFilter.OFF`][pact_ffi.LevelFilter.OFF]. + + The subscriber installed by + [`init_with_log_level`][pact_ffi.init_with_log_level] and the `log_to_*` + functions admits events up to the most verbose of the sink levels and this + level. Call this function before applying the logger in order to receive + events more verbose than the sinks. With [`init`][pact_ffi.init], the + environment filter bounds what the callback receives. + + [Rust + `pactffi_set_log_callback_level`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/log/ffi/fn.pactffi_set_log_callback_level.html) + + Args: + level_filter: + The most verbose level to forward. If a string is given, it must + match one of the [`LevelFilter`][pact_ffi.LevelFilter] values (case + insensitive). + """ + if isinstance(level_filter, str): + level_filter = LevelFilter[level_filter.upper()] + lib.pactffi_set_log_callback_level(level_filter.value) + + def fetch_log_buffer(log_id: str) -> str: """ Fetch the in-memory logger buffer contents. [Rust - `pactffi_fetch_log_buffer`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/log/ffi/fn.pactffi_fetch_log_buffer.html) + `pactffi_fetch_log_buffer`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/log/ffi/fn.pactffi_fetch_log_buffer.html) This will only have any contents if the `buffer` sink has been configured to log to. The contents will be allocated on the heap and will need to be freed @@ -2535,7 +2639,7 @@ def parse_pact_json(json: str) -> Pact: Parses the provided JSON into a Pact model. [Rust - `pactffi_parse_pact_json`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/fn.pactffi_parse_pact_json.html) + `pactffi_parse_pact_json`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/fn.pactffi_parse_pact_json.html) The returned Pact model must be freed with the `pactffi_pact_model_delete` function when no longer needed. @@ -2552,7 +2656,7 @@ def pact_model_delete(pact: Pact) -> None: """ Frees the memory used by the Pact model. - [Rust `pactffi_pact_model_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/fn.pactffi_pact_model_delete.html) + [Rust `pactffi_pact_model_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/fn.pactffi_pact_model_delete.html) """ lib.pactffi_pact_model_delete(pact._ptr) @@ -2562,7 +2666,7 @@ def pact_model_interaction_iterator(pact: Pact) -> PactInteractionIterator: Returns an iterator over all the interactions in the Pact. [Rust - `pactffi_pact_model_interaction_iterator`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/fn.pactffi_pact_model_interaction_iterator.html) + `pactffi_pact_model_interaction_iterator`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/fn.pactffi_pact_model_interaction_iterator.html) The iterator will contain a copy of the interactions, so it will not be affected but mutations to the Pact model and will still function if the Pact @@ -2584,7 +2688,7 @@ def pact_spec_version(pact: Pact) -> PactSpecification: """ Returns the Pact specification enum that the Pact is for. - [Rust `pactffi_pact_spec_version`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/fn.pactffi_pact_spec_version.html) + [Rust `pactffi_pact_spec_version`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/fn.pactffi_pact_spec_version.html) """ raise NotImplementedError @@ -2593,7 +2697,7 @@ def pact_interaction_delete(interaction: PactInteraction) -> None: """ Frees the memory used by the Pact interaction model. - [Rust `pactffi_pact_interaction_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/fn.pactffi_pact_interaction_delete.html) + [Rust `pactffi_pact_interaction_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/fn.pactffi_pact_interaction_delete.html) """ lib.pactffi_pact_interaction_delete(interaction._ptr) @@ -2602,7 +2706,7 @@ def async_message_new() -> AsynchronousMessage: """ Get a mutable pointer to a newly-created default message on the heap. - [Rust `pactffi_async_message_new`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/async_message/fn.pactffi_async_message_new.html) + [Rust `pactffi_async_message_new`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/async_message/fn.pactffi_async_message_new.html) # Safety @@ -2619,7 +2723,7 @@ def async_message_delete(message: AsynchronousMessage) -> None: """ Destroy the `AsynchronousMessage` being pointed to. - [Rust `pactffi_async_message_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/async_message/fn.pactffi_async_message_delete.html) + [Rust `pactffi_async_message_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/async_message/fn.pactffi_async_message_delete.html) """ lib.pactffi_async_message_delete(message._ptr) @@ -2629,7 +2733,7 @@ def async_message_get_contents(message: AsynchronousMessage) -> MessageContents Get the message contents of an `AsynchronousMessage` as a `MessageContents` pointer. [Rust - `pactffi_async_message_get_contents`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/async_message/fn.pactffi_async_message_get_contents.html) + `pactffi_async_message_get_contents`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/async_message/fn.pactffi_async_message_get_contents.html) If the message contents are missing, this function will return `None`. """ @@ -2648,7 +2752,7 @@ def async_message_generate_contents( contents as would be received by the consumer. [Rust - `pactffi_async_message_generate_contents`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/async_message/fn.pactffi_async_message_generate_contents.html) + `pactffi_async_message_generate_contents`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/async_message/fn.pactffi_async_message_generate_contents.html) If the message contents are missing, this function will return `None`. """ @@ -2662,7 +2766,7 @@ def async_message_get_contents_str(message: AsynchronousMessage) -> str: """ Get the message contents of an `AsynchronousMessage` in string form. - [Rust `pactffi_async_message_get_contents_str`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/async_message/fn.pactffi_async_message_get_contents_str.html) + [Rust `pactffi_async_message_get_contents_str`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/async_message/fn.pactffi_async_message_get_contents_str.html) # Safety @@ -2689,7 +2793,7 @@ def async_message_set_contents_str( Sets the contents of the message as a string. [Rust - `pactffi_async_message_set_contents_str`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/async_message/fn.pactffi_async_message_set_contents_str.html) + `pactffi_async_message_set_contents_str`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/async_message/fn.pactffi_async_message_set_contents_str.html) - `message` - the message to set the contents for - `contents` - pointer to contents to copy from. Must be a valid @@ -2717,7 +2821,7 @@ def async_message_get_contents_length(message: AsynchronousMessage) -> int: Get the length of the contents of a `AsynchronousMessage`. [Rust - `pactffi_async_message_get_contents_length`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/async_message/fn.pactffi_async_message_get_contents_length.html) + `pactffi_async_message_get_contents_length`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/async_message/fn.pactffi_async_message_get_contents_length.html) # Safety @@ -2736,7 +2840,7 @@ def async_message_get_contents_bin(message: AsynchronousMessage) -> str: Get the contents of an `AsynchronousMessage` as bytes. [Rust - `pactffi_async_message_get_contents_bin`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/async_message/fn.pactffi_async_message_get_contents_bin.html) + `pactffi_async_message_get_contents_bin`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/async_message/fn.pactffi_async_message_get_contents_bin.html) # Safety @@ -2763,7 +2867,7 @@ def async_message_set_contents_bin( Sets the contents of the message as an array of bytes. [Rust - `pactffi_async_message_set_contents_bin`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/async_message/fn.pactffi_async_message_set_contents_bin.html) + `pactffi_async_message_set_contents_bin`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/async_message/fn.pactffi_async_message_set_contents_bin.html) * `message` - the message to set the contents for * `contents` - pointer to contents to copy from @@ -2790,7 +2894,7 @@ def async_message_get_description(message: AsynchronousMessage) -> str: Get a copy of the description. [Rust - `pactffi_async_message_get_description`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/async_message/fn.pactffi_async_message_get_description.html) + `pactffi_async_message_get_description`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/async_message/fn.pactffi_async_message_get_description.html) Raises: RuntimeError: @@ -2810,7 +2914,7 @@ def async_message_set_description( """ Write the `description` field on the `AsynchronousMessage`. - [Rust `pactffi_async_message_set_description`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/async_message/fn.pactffi_async_message_set_description.html) + [Rust `pactffi_async_message_set_description`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/async_message/fn.pactffi_async_message_set_description.html) # Safety @@ -2835,7 +2939,7 @@ def async_message_get_provider_state( Get a copy of the provider state at the given index from this message. [Rust - `pactffi_async_message_get_provider_state`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/async_message/fn.pactffi_async_message_get_provider_state.html) + `pactffi_async_message_get_provider_state`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/async_message/fn.pactffi_async_message_get_provider_state.html) Raises: RuntimeError: @@ -2854,7 +2958,7 @@ def async_message_get_provider_state_iter( """ Get an iterator over provider states. - [Rust `pactffi_async_message_get_provider_state_iter`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/async_message/fn.pactffi_async_message_get_provider_state_iter.html) + [Rust `pactffi_async_message_get_provider_state_iter`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/async_message/fn.pactffi_async_message_get_provider_state_iter.html) # Safety @@ -2869,7 +2973,7 @@ def consumer_get_name(consumer: Consumer) -> str: r""" Get a copy of this consumer's name. - [Rust `pactffi_consumer_get_name`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/consumer/fn.pactffi_consumer_get_name.html) + [Rust `pactffi_consumer_get_name`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/consumer/fn.pactffi_consumer_get_name.html) The copy must be deleted with `pactffi_string_delete`. @@ -2915,7 +3019,7 @@ def pact_get_consumer(pact: Pact) -> Consumer: `pactffi_pact_consumer_delete` when no longer required. [Rust - `pactffi_pact_get_consumer`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/consumer/fn.pactffi_pact_get_consumer.html) + `pactffi_pact_get_consumer`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/consumer/fn.pactffi_pact_get_consumer.html) # Errors @@ -2929,7 +3033,7 @@ def pact_consumer_delete(consumer: Consumer) -> None: """ Frees the memory used by the Pact consumer. - [Rust `pactffi_pact_consumer_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/consumer/fn.pactffi_pact_consumer_delete.html) + [Rust `pactffi_pact_consumer_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/consumer/fn.pactffi_pact_consumer_delete.html) """ raise NotImplementedError @@ -2945,7 +3049,7 @@ def message_contents_delete(contents: MessageContents) -> None: Deleting a message content which is associated with an interaction will result in undefined behaviour. - [Rust `pactffi_message_contents_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/contents/fn.pactffi_message_contents_delete.html) + [Rust `pactffi_message_contents_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/contents/fn.pactffi_message_contents_delete.html) """ lib.pactffi_message_contents_delete(contents._ptr) @@ -2954,7 +3058,7 @@ def message_contents_get_contents_str(contents: MessageContents) -> str | None: """ Get the message contents in string form. - [Rust `pactffi_message_contents_get_contents_str`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/contents/fn.pactffi_message_contents_get_contents_str.html) + [Rust `pactffi_message_contents_get_contents_str`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/contents/fn.pactffi_message_contents_get_contents_str.html) If the message has no contents or contain invalid UTF-8 characters, this function will return `None`. @@ -2974,7 +3078,7 @@ def message_contents_set_contents_str( Sets the contents of the message as a string. [Rust - `pactffi_message_contents_set_contents_str`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/contents/fn.pactffi_message_contents_set_contents_str.html) + `pactffi_message_contents_set_contents_str`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/contents/fn.pactffi_message_contents_set_contents_str.html) * `contents` - the message contents to set the contents for * `contents_str` - pointer to contents to copy from. Must be a valid @@ -3001,7 +3105,7 @@ def message_contents_get_contents_length(contents: MessageContents) -> int: """ Get the length of the message contents. - [Rust `pactffi_message_contents_get_contents_length`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/contents/fn.pactffi_message_contents_get_contents_length.html) + [Rust `pactffi_message_contents_get_contents_length`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/contents/fn.pactffi_message_contents_get_contents_length.html) If the message has not contents, this function will return 0. """ @@ -3013,7 +3117,7 @@ def message_contents_get_contents_bin(contents: MessageContents) -> bytes | None Get the contents of a message as a pointer to an array of bytes. [Rust - `pactffi_message_contents_get_contents_bin`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/contents/fn.pactffi_message_contents_get_contents_bin.html) + `pactffi_message_contents_get_contents_bin`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/contents/fn.pactffi_message_contents_get_contents_bin.html) If the message has no contents, this function will return `None`. """ @@ -3036,7 +3140,7 @@ def message_contents_set_contents_bin( Sets the contents of the message as an array of bytes. [Rust - `pactffi_message_contents_set_contents_bin`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/contents/fn.pactffi_message_contents_set_contents_bin.html) + `pactffi_message_contents_set_contents_bin`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/contents/fn.pactffi_message_contents_set_contents_bin.html) * `message` - the message contents to set the contents for * `contents_bin` - pointer to contents to copy from @@ -3065,7 +3169,7 @@ def message_contents_get_metadata_iter( Get an iterator over the metadata of a message. [Rust - `pactffi_message_contents_get_metadata_iter`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/contents/fn.pactffi_message_contents_get_metadata_iter.html) + `pactffi_message_contents_get_metadata_iter`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/contents/fn.pactffi_message_contents_get_metadata_iter.html) # Safety @@ -3094,7 +3198,7 @@ def message_contents_get_matching_rule_iter( Get an iterator over the matching rules for a category of a message. [Rust - `pactffi_message_contents_get_matching_rule_iter`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/contents/fn.pactffi_message_contents_get_matching_rule_iter.html) + `pactffi_message_contents_get_matching_rule_iter`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/contents/fn.pactffi_message_contents_get_matching_rule_iter.html) The returned pointer must be deleted with `pactffi_matching_rules_iter_delete` when done with it. @@ -3136,7 +3240,7 @@ def request_contents_get_matching_rule_iter( r""" Get an iterator over the matching rules for a category of an HTTP request. - [Rust `pactffi_request_contents_get_matching_rule_iter`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/contents/fn.pactffi_request_contents_get_matching_rule_iter.html) + [Rust `pactffi_request_contents_get_matching_rule_iter`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/contents/fn.pactffi_request_contents_get_matching_rule_iter.html) The returned pointer must be deleted with `pactffi_matching_rules_iter_delete` when done with it. @@ -3173,7 +3277,7 @@ def response_contents_get_matching_rule_iter( r""" Get an iterator over the matching rules for a category of an HTTP response. - [Rust `pactffi_response_contents_get_matching_rule_iter`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/contents/fn.pactffi_response_contents_get_matching_rule_iter.html) + [Rust `pactffi_response_contents_get_matching_rule_iter`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/contents/fn.pactffi_response_contents_get_matching_rule_iter.html) The returned pointer must be deleted with `pactffi_matching_rules_iter_delete` when done with it. @@ -3211,7 +3315,7 @@ def message_contents_get_generators_iter( Get an iterator over the generators for a category of a message. [Rust - `pactffi_message_contents_get_generators_iter`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/contents/fn.pactffi_message_contents_get_generators_iter.html) + `pactffi_message_contents_get_generators_iter`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/contents/fn.pactffi_message_contents_get_generators_iter.html) # Safety @@ -3237,7 +3341,7 @@ def request_contents_get_generators_iter( Get an iterator over the generators for a category of an HTTP request. [Rust - `pactffi_request_contents_get_generators_iter`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/contents/fn.pactffi_request_contents_get_generators_iter.html) + `pactffi_request_contents_get_generators_iter`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/contents/fn.pactffi_request_contents_get_generators_iter.html) The returned pointer must be deleted with `pactffi_generators_iter_delete` when done with it. @@ -3262,7 +3366,7 @@ def response_contents_get_generators_iter( Get an iterator over the generators for a category of an HTTP response. [Rust - `pactffi_response_contents_get_generators_iter`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/contents/fn.pactffi_response_contents_get_generators_iter.html) + `pactffi_response_contents_get_generators_iter`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/contents/fn.pactffi_response_contents_get_generators_iter.html) The returned pointer must be deleted with `pactffi_generators_iter_delete` when done with it. @@ -3287,7 +3391,7 @@ def parse_matcher_definition(expression: str) -> MatchingRuleDefinitionResult: any generator. [Rust - `pactffi_parse_matcher_definition`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/expressions/fn.pactffi_parse_matcher_definition.html) + `pactffi_parse_matcher_definition`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/expressions/fn.pactffi_parse_matcher_definition.html) The following are examples of matching rule definitions: @@ -3323,7 +3427,7 @@ def matcher_definition_error(definition: MatchingRuleDefinitionResult) -> str: using the `pactffi_string_delete` function once done with it. [Rust - `pactffi_matcher_definition_error`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/expressions/fn.pactffi_matcher_definition_error.html) + `pactffi_matcher_definition_error`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/expressions/fn.pactffi_matcher_definition_error.html) """ raise NotImplementedError @@ -3337,7 +3441,7 @@ def matcher_definition_value(definition: MatchingRuleDefinitionResult) -> str: the `pactffi_string_delete` function once done with it. [Rust - `pactffi_matcher_definition_value`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/expressions/fn.pactffi_matcher_definition_value.html) + `pactffi_matcher_definition_value`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/expressions/fn.pactffi_matcher_definition_value.html) Note that different expressions values can have types other than a string. Use `pactffi_matcher_definition_value_type` to get the actual type of the @@ -3351,7 +3455,7 @@ def matcher_definition_delete(definition: MatchingRuleDefinitionResult) -> None: """ Frees the memory used by the result of parsing the matching definition expression. - [Rust `pactffi_matcher_definition_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/expressions/fn.pactffi_matcher_definition_delete.html) + [Rust `pactffi_matcher_definition_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/expressions/fn.pactffi_matcher_definition_delete.html) """ raise NotImplementedError @@ -3364,7 +3468,7 @@ def matcher_definition_generator(definition: MatchingRuleDefinitionResult) -> Ge NULL pointer, otherwise returns the generator as a pointer. [Rust - `pactffi_matcher_definition_generator`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/expressions/fn.pactffi_matcher_definition_generator.html) + `pactffi_matcher_definition_generator`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/expressions/fn.pactffi_matcher_definition_generator.html) The generator pointer will be a valid pointer as long as `pactffi_matcher_definition_delete` has not been called on the definition. @@ -3383,7 +3487,7 @@ def matcher_definition_value_type( If there was an error parsing the expression, it will return Unknown. [Rust - `pactffi_matcher_definition_value_type`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/expressions/fn.pactffi_matcher_definition_value_type.html) + `pactffi_matcher_definition_value_type`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/expressions/fn.pactffi_matcher_definition_value_type.html) """ raise NotImplementedError @@ -3392,7 +3496,7 @@ def matching_rule_iter_delete(iter: MatchingRuleIterator) -> None: """ Free the iterator when you're done using it. - [Rust `pactffi_matching_rule_iter_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/expressions/fn.pactffi_matching_rule_iter_delete.html) + [Rust `pactffi_matching_rule_iter_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/expressions/fn.pactffi_matching_rule_iter_delete.html) """ raise NotImplementedError @@ -3407,7 +3511,7 @@ def matcher_definition_iter( `pactffi_matching_rule_iter_delete` function once done with it. [Rust - `pactffi_matcher_definition_iter`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/expressions/fn.pactffi_matcher_definition_iter.html) + `pactffi_matcher_definition_iter`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/expressions/fn.pactffi_matcher_definition_iter.html) If there was an error parsing the expression, this function will return a NULL pointer. @@ -3423,7 +3527,7 @@ def matching_rule_iter_next(iter: MatchingRuleIterator) -> MatchingRuleResult: deleted but will be cleaned up when the iterator is deleted. [Rust - `pactffi_matching_rule_iter_next`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/expressions/fn.pactffi_matching_rule_iter_next.html) + `pactffi_matching_rule_iter_next`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/expressions/fn.pactffi_matching_rule_iter_next.html) Will return a NULL pointer when the iterator has advanced past the end of the list. @@ -3445,7 +3549,7 @@ def matching_rule_id(rule_result: MatchingRuleResult) -> int: Return the ID of the matching rule. [Rust - `pactffi_matching_rule_id`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/expressions/fn.pactffi_matching_rule_id.html) + `pactffi_matching_rule_id`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/expressions/fn.pactffi_matching_rule_id.html) The ID corresponds to the following rules: @@ -3497,7 +3601,7 @@ def matching_rule_value(rule_result: MatchingRuleResult) -> str: pointer. [Rust - `pactffi_matching_rule_value`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/expressions/fn.pactffi_matching_rule_value.html) + `pactffi_matching_rule_value`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/expressions/fn.pactffi_matching_rule_value.html) The associated values for the rules are: @@ -3546,7 +3650,7 @@ def matching_rule_pointer(rule_result: MatchingRuleResult) -> MatchingRule: Will return a NULL pointer if the matching rule result was a reference. [Rust - `pactffi_matching_rule_pointer`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/expressions/fn.pactffi_matching_rule_pointer.html) + `pactffi_matching_rule_pointer`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/expressions/fn.pactffi_matching_rule_pointer.html) # Safety @@ -3564,7 +3668,7 @@ def matching_rule_reference_name(rule_result: MatchingRuleResult) -> str: structure. I.e., [Rust - `pactffi_matching_rule_reference_name`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/expressions/fn.pactffi_matching_rule_reference_name.html) + `pactffi_matching_rule_reference_name`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/expressions/fn.pactffi_matching_rule_reference_name.html) ```json { @@ -3591,7 +3695,7 @@ def validate_datetime(value: str, format: str) -> None: Validates the date/time value against the date/time format string. [Rust - `pactffi_validate_datetime`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/expressions/fn.pactffi_validate_datetime.html) + `pactffi_validate_datetime`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/expressions/fn.pactffi_validate_datetime.html) Raises: ValueError: @@ -3618,7 +3722,7 @@ def generator_to_json(generator: Generator) -> str: Get the JSON form of the generator. [Rust - `pactffi_generator_to_json`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/generators/fn.pactffi_generator_to_json.html) + `pactffi_generator_to_json`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/generators/fn.pactffi_generator_to_json.html) The returned string must be deleted with `pactffi_string_delete`. @@ -3641,7 +3745,7 @@ def generator_generate_string(generator: Generator, context_json: str) -> str: function). [Rust - `pactffi_generator_generate_string`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/generators/fn.pactffi_generator_generate_string.html) + `pactffi_generator_generate_string`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/generators/fn.pactffi_generator_generate_string.html) If anything goes wrong, it will return a NULL pointer. """ @@ -3664,7 +3768,7 @@ def generator_generate_integer(generator: Generator, context_json: str) -> int: should be the values returned from the Provider State callback function). [Rust - `pactffi_generator_generate_integer`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/generators/fn.pactffi_generator_generate_integer.html) + `pactffi_generator_generate_integer`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/generators/fn.pactffi_generator_generate_integer.html) If anything goes wrong or the generator is not a type that can generate an integer value, it will return a zero value. @@ -3680,7 +3784,7 @@ def generators_iter_delete(iter: GeneratorCategoryIterator) -> None: Free the iterator when you're done using it. [Rust - `pactffi_generators_iter_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/generators/fn.pactffi_generators_iter_delete.html) + `pactffi_generators_iter_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/generators/fn.pactffi_generators_iter_delete.html) """ lib.pactffi_generators_iter_delete(iter._ptr) @@ -3690,7 +3794,7 @@ def generators_iter_next(iter: GeneratorCategoryIterator) -> GeneratorKeyValuePa Get the next path and generator out of the iterator, if possible. [Rust - `pactffi_generators_iter_next`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/generators/fn.pactffi_generators_iter_next.html) + `pactffi_generators_iter_next`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/generators/fn.pactffi_generators_iter_next.html) The returned pointer must be deleted with `pactffi_generator_iter_pair_delete`. @@ -3710,7 +3814,7 @@ def generators_iter_pair_delete(pair: GeneratorKeyValuePair) -> None: Free a pair of key and value returned from `pactffi_generators_iter_next`. [Rust - `pactffi_generators_iter_pair_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/generators/fn.pactffi_generators_iter_pair_delete.html) + `pactffi_generators_iter_pair_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/generators/fn.pactffi_generators_iter_pair_delete.html) """ lib.pactffi_generators_iter_pair_delete(pair._ptr) @@ -3719,7 +3823,7 @@ def sync_http_new() -> SynchronousHttp: """ Get a mutable pointer to a newly-created default interaction on the heap. - [Rust `pactffi_sync_http_new`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/http_interaction/fn.pactffi_sync_http_new.html) + [Rust `pactffi_sync_http_new`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_new.html) # Safety @@ -3737,7 +3841,7 @@ def sync_http_delete(interaction: SynchronousHttp) -> None: Destroy the `SynchronousHttp` interaction being pointed to. [Rust - `pactffi_sync_http_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/http_interaction/fn.pactffi_sync_http_delete.html) + `pactffi_sync_http_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_delete.html) """ lib.pactffi_sync_http_delete(interaction._ptr) @@ -3747,7 +3851,7 @@ def sync_http_get_request(interaction: SynchronousHttp) -> HttpRequest: Get the request of a `SynchronousHttp` interaction. [Rust - `pactffi_sync_http_get_request`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_request.html) + `pactffi_sync_http_get_request`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_request.html) # Safety @@ -3767,7 +3871,7 @@ def sync_http_get_request_contents(interaction: SynchronousHttp) -> str | None: Get the request contents of a `SynchronousHttp` interaction in string form. [Rust - `pactffi_sync_http_get_request_contents`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_request_contents.html) + `pactffi_sync_http_get_request_contents`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_request_contents.html) Note that this function will return `None` if either the body is missing or is `null`. @@ -3787,7 +3891,7 @@ def sync_http_set_request_contents( Sets the request contents of the interaction. [Rust - `pactffi_sync_http_set_request_contents`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/http_interaction/fn.pactffi_sync_http_set_request_contents.html) + `pactffi_sync_http_set_request_contents`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_set_request_contents.html) - `interaction` - the interaction to set the request contents for - `contents` - pointer to contents to copy from. Must be a valid @@ -3815,7 +3919,7 @@ def sync_http_get_request_contents_length(interaction: SynchronousHttp) -> int: Get the length of the request contents of a `SynchronousHttp` interaction. [Rust - `pactffi_sync_http_get_request_contents_length`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_request_contents_length.html) + `pactffi_sync_http_get_request_contents_length`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_request_contents_length.html) This function will return 0 if the body is missing. """ @@ -3827,7 +3931,7 @@ def sync_http_get_request_contents_bin(interaction: SynchronousHttp) -> bytes | Get the request contents of a `SynchronousHttp` interaction as bytes. [Rust - `pactffi_sync_http_get_request_contents_bin`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_request_contents_bin.html) + `pactffi_sync_http_get_request_contents_bin`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_request_contents_bin.html) Note that this function will return `None` if either the body is missing or is `null`. @@ -3851,7 +3955,7 @@ def sync_http_set_request_contents_bin( Sets the request contents of the interaction as an array of bytes. [Rust - `pactffi_sync_http_set_request_contents_bin`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/http_interaction/fn.pactffi_sync_http_set_request_contents_bin.html) + `pactffi_sync_http_set_request_contents_bin`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_set_request_contents_bin.html) - `interaction` - the interaction to set the request contents for - `contents` - pointer to contents to copy from @@ -3878,7 +3982,7 @@ def sync_http_get_response(interaction: SynchronousHttp) -> HttpResponse: Get the response of a `SynchronousHttp` interaction. [Rust - `pactffi_sync_http_get_response`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_response.html) + `pactffi_sync_http_get_response`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_response.html) # Safety @@ -3898,7 +4002,7 @@ def sync_http_get_response_contents(interaction: SynchronousHttp) -> str | None: Get the response contents of a `SynchronousHttp` interaction in string form. [Rust - `pactffi_sync_http_get_response_contents`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_response_contents.html) + `pactffi_sync_http_get_response_contents`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_response_contents.html) Note that this function will return `None` if either the body is missing or is `null`. @@ -3918,7 +4022,7 @@ def sync_http_set_response_contents( Sets the response contents of the interaction. [Rust - `pactffi_sync_http_set_response_contents`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/http_interaction/fn.pactffi_sync_http_set_response_contents.html) + `pactffi_sync_http_set_response_contents`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_set_response_contents.html) - `interaction` - the interaction to set the response contents for - `contents` - pointer to contents to copy from. Must be a valid @@ -3946,7 +4050,7 @@ def sync_http_get_response_contents_length(interaction: SynchronousHttp) -> int: Get the length of the response contents of a `SynchronousHttp` interaction. [Rust - `pactffi_sync_http_get_response_contents_length`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_response_contents_length.html) + `pactffi_sync_http_get_response_contents_length`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_response_contents_length.html) This function will return 0 if the body is missing. """ @@ -3958,7 +4062,7 @@ def sync_http_get_response_contents_bin(interaction: SynchronousHttp) -> bytes | Get the response contents of a `SynchronousHttp` interaction as bytes. [Rust - `pactffi_sync_http_get_response_contents_bin`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_response_contents_bin.html) + `pactffi_sync_http_get_response_contents_bin`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_response_contents_bin.html) Note that this function will return `None` if either the body is missing or is `null`. @@ -3982,7 +4086,7 @@ def sync_http_set_response_contents_bin( Sets the response contents of the `SynchronousHttp` interaction as bytes. [Rust - `pactffi_sync_http_set_response_contents_bin`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/http_interaction/fn.pactffi_sync_http_set_response_contents_bin.html) + `pactffi_sync_http_set_response_contents_bin`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_set_response_contents_bin.html) - `interaction` - the interaction to set the response contents for - `contents` - pointer to contents to copy from @@ -4009,7 +4113,7 @@ def sync_http_get_description(interaction: SynchronousHttp) -> str: Get a copy of the description. [Rust - `pactffi_sync_http_get_description`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_description.html) + `pactffi_sync_http_get_description`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_description.html) Raises: RuntimeError: @@ -4027,7 +4131,7 @@ def sync_http_set_description(interaction: SynchronousHttp, description: str) -> Write the `description` field on the `SynchronousHttp`. [Rust - `pactffi_sync_http_set_description`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/http_interaction/fn.pactffi_sync_http_set_description.html) + `pactffi_sync_http_set_description`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_set_description.html) # Safety @@ -4052,7 +4156,7 @@ def sync_http_get_provider_state( Get a copy of the provider state at the given index from this interaction. [Rust - `pactffi_sync_http_get_provider_state`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_provider_state.html) + `pactffi_sync_http_get_provider_state`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_provider_state.html) # Safety @@ -4078,7 +4182,7 @@ def sync_http_get_provider_state_iter( Get an iterator over provider states. [Rust - `pactffi_sync_http_get_provider_state_iter`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_provider_state_iter.html) + `pactffi_sync_http_get_provider_state_iter`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_provider_state_iter.html) # Safety @@ -4101,7 +4205,7 @@ def pact_interaction_as_synchronous_http( """ Cast this interaction to a `SynchronousHttp` interaction. - [Rust `pactffi_pact_interaction_as_synchronous_http`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/interactions/fn.pactffi_pact_interaction_as_synchronous_http.html) + [Rust `pactffi_pact_interaction_as_synchronous_http`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/interactions/fn.pactffi_pact_interaction_as_synchronous_http.html) Args: interaction: @@ -4131,7 +4235,7 @@ def pact_interaction_as_asynchronous_message( Note that if the interaction is a V3 `Message`, it will be converted to a V4 `AsynchronousMessage` before being returned. - [Rust `pactffi_pact_interaction_as_asynchronous_message`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/interactions/fn.pactffi_pact_interaction_as_asynchronous_message.html) + [Rust `pactffi_pact_interaction_as_asynchronous_message`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/interactions/fn.pactffi_pact_interaction_as_asynchronous_message.html) Args: interaction: @@ -4158,7 +4262,7 @@ def pact_interaction_as_synchronous_message( """ Cast this interaction to a `SynchronousMessage` interaction. - [Rust `pactffi_pact_interaction_as_synchronous_message`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/interactions/fn.pactffi_pact_interaction_as_synchronous_message.html) + [Rust `pactffi_pact_interaction_as_synchronous_message`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/interactions/fn.pactffi_pact_interaction_as_synchronous_message.html) Args: interaction: @@ -4184,7 +4288,7 @@ def pact_async_message_iter_next(iter: PactAsyncMessageIterator) -> Asynchronous Get the next asynchronous message from the iterator. [Rust - `pactffi_pact_async_message_iter_next`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/iterators/fn.pactffi_pact_async_message_iter_next.html) + `pactffi_pact_async_message_iter_next`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/iterators/fn.pactffi_pact_async_message_iter_next.html) Raises: StopIteration: @@ -4201,7 +4305,7 @@ def pact_async_message_iter_delete(iter: PactAsyncMessageIterator) -> None: Free the iterator when you're done using it. [Rust - `pactffi_pact_async_message_iter_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/iterators/fn.pactffi_pact_async_message_iter_delete.html) + `pactffi_pact_async_message_iter_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/iterators/fn.pactffi_pact_async_message_iter_delete.html) """ lib.pactffi_pact_async_message_iter_delete(iter._ptr) @@ -4211,7 +4315,7 @@ def pact_sync_message_iter_next(iter: PactSyncMessageIterator) -> SynchronousMes Get the next synchronous request/response message from the V4 pact. [Rust - `pactffi_pact_sync_message_iter_next`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/iterators/fn.pactffi_pact_sync_message_iter_next.html) + `pactffi_pact_sync_message_iter_next`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/iterators/fn.pactffi_pact_sync_message_iter_next.html) Raises: StopIteration: @@ -4228,7 +4332,7 @@ def pact_sync_message_iter_delete(iter: PactSyncMessageIterator) -> None: Free the iterator when you're done using it. [Rust - `pactffi_pact_sync_message_iter_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/iterators/fn.pactffi_pact_sync_message_iter_delete.html) + `pactffi_pact_sync_message_iter_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/iterators/fn.pactffi_pact_sync_message_iter_delete.html) """ lib.pactffi_pact_sync_message_iter_delete(iter._ptr) @@ -4238,7 +4342,7 @@ def pact_sync_http_iter_next(iter: PactSyncHttpIterator) -> SynchronousHttp: Get the next synchronous HTTP request/response interaction from the V4 pact. [Rust - `pactffi_pact_sync_http_iter_next`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/iterators/fn.pactffi_pact_sync_http_iter_next.html) + `pactffi_pact_sync_http_iter_next`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/iterators/fn.pactffi_pact_sync_http_iter_next.html) Raises: StopIteration: @@ -4255,7 +4359,7 @@ def pact_sync_http_iter_delete(iter: PactSyncHttpIterator) -> None: Free the iterator when you're done using it. [Rust - `pactffi_pact_sync_http_iter_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/iterators/fn.pactffi_pact_sync_http_iter_delete.html) + `pactffi_pact_sync_http_iter_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/iterators/fn.pactffi_pact_sync_http_iter_delete.html) """ lib.pactffi_pact_sync_http_iter_delete(iter._ptr) @@ -4265,7 +4369,7 @@ def pact_interaction_iter_next(iter: PactInteractionIterator) -> PactInteraction Get the next interaction from the pact. [Rust - `pactffi_pact_interaction_iter_next`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/iterators/fn.pactffi_pact_interaction_iter_next.html) + `pactffi_pact_interaction_iter_next`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/iterators/fn.pactffi_pact_interaction_iter_next.html) Raises: StopIteration: @@ -4282,7 +4386,7 @@ def pact_interaction_iter_delete(iter: PactInteractionIterator) -> None: Free the iterator when you're done using it. [Rust - `pactffi_pact_interaction_iter_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/iterators/fn.pactffi_pact_interaction_iter_delete.html) + `pactffi_pact_interaction_iter_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/iterators/fn.pactffi_pact_interaction_iter_delete.html) """ lib.pactffi_pact_interaction_iter_delete(iter._ptr) @@ -4292,7 +4396,7 @@ def pact_message_iter_next(iter: PactMessageIterator) -> PactInteraction: Get the next interaction from the pact. [Rust - `pactffi_pact_message_iter_next`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/iterators/fn.pactffi_pact_message_iter_next.html) + `pactffi_pact_message_iter_next`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/iterators/fn.pactffi_pact_message_iter_next.html) Raises: StopIteration: @@ -4309,7 +4413,7 @@ def pact_message_iter_delete(iter: PactMessageIterator) -> None: Free the iterator when you're done using it. [Rust - `pactffi_pact_message_iter_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/iterators/fn.pactffi_pact_message_iter_delete.html) + `pactffi_pact_message_iter_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/iterators/fn.pactffi_pact_message_iter_delete.html) """ lib.pactffi_pact_message_iter_delete(iter._ptr) @@ -4319,7 +4423,7 @@ def matching_rule_to_json(rule: MatchingRule) -> str: Get the JSON form of the matching rule. [Rust - `pactffi_matching_rule_to_json`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/matching_rules/fn.pactffi_matching_rule_to_json.html) + `pactffi_matching_rule_to_json`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/matching_rules/fn.pactffi_matching_rule_to_json.html) The returned string must be deleted with `pactffi_string_delete`. @@ -4336,7 +4440,7 @@ def matching_rules_iter_delete(iter: MatchingRuleCategoryIterator) -> None: Free the iterator when you're done using it. [Rust - `pactffi_matching_rules_iter_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/matching_rules/fn.pactffi_matching_rules_iter_delete.html) + `pactffi_matching_rules_iter_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/matching_rules/fn.pactffi_matching_rules_iter_delete.html) """ lib.pactffi_matching_rules_iter_delete(iter._ptr) @@ -4348,7 +4452,7 @@ def matching_rules_iter_next( Get the next path and matching rule out of the iterator, if possible. [Rust - `pactffi_matching_rules_iter_next`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/matching_rules/fn.pactffi_matching_rules_iter_next.html) + `pactffi_matching_rules_iter_next`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/matching_rules/fn.pactffi_matching_rules_iter_next.html) The returned pointer must be deleted with `pactffi_matching_rules_iter_pair_delete`. @@ -4370,7 +4474,7 @@ def matching_rules_iter_pair_delete(pair: MatchingRuleKeyValuePair) -> None: Free a pair of key and value returned from `message_metadata_iter_next`. [Rust - `pactffi_matching_rules_iter_pair_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/matching_rules/fn.pactffi_matching_rules_iter_pair_delete.html) + `pactffi_matching_rules_iter_pair_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/matching_rules/fn.pactffi_matching_rules_iter_pair_delete.html) """ lib.pactffi_matching_rules_iter_pair_delete(pair._ptr) @@ -4380,7 +4484,7 @@ def provider_state_iter_next(iter: ProviderStateIterator) -> ProviderState: Get the next value from the iterator. [Rust - `pactffi_provider_state_iter_next`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/message/fn.pactffi_provider_state_iter_next.html) + `pactffi_provider_state_iter_next`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/message/fn.pactffi_provider_state_iter_next.html) # Safety @@ -4401,7 +4505,7 @@ def provider_state_iter_delete(iter: ProviderStateIterator) -> None: Delete the iterator. [Rust - `pactffi_provider_state_iter_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/message/fn.pactffi_provider_state_iter_delete.html) + `pactffi_provider_state_iter_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/message/fn.pactffi_provider_state_iter_delete.html) """ lib.pactffi_provider_state_iter_delete(iter._ptr) @@ -4411,7 +4515,7 @@ def message_metadata_iter_next(iter: MessageMetadataIterator) -> MessageMetadata Get the next key and value out of the iterator, if possible. [Rust - `pactffi_message_metadata_iter_next`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/message/fn.pactffi_message_metadata_iter_next.html) + `pactffi_message_metadata_iter_next`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/message/fn.pactffi_message_metadata_iter_next.html) The returned pointer must be deleted with `pactffi_message_metadata_pair_delete`. @@ -4437,7 +4541,7 @@ def message_metadata_iter_delete(iter: MessageMetadataIterator) -> None: Free the metadata iterator when you're done using it. [Rust - `pactffi_message_metadata_iter_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/message/fn.pactffi_message_metadata_iter_delete.html) + `pactffi_message_metadata_iter_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/message/fn.pactffi_message_metadata_iter_delete.html) """ lib.pactffi_message_metadata_iter_delete(iter._ptr) @@ -4447,7 +4551,7 @@ def message_metadata_pair_delete(pair: MessageMetadataPair) -> None: Free a pair of key and value returned from `message_metadata_iter_next`. [Rust - `pactffi_message_metadata_pair_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/message/fn.pactffi_message_metadata_pair_delete.html) + `pactffi_message_metadata_pair_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/message/fn.pactffi_message_metadata_pair_delete.html) """ lib.pactffi_message_metadata_pair_delete(pair._ptr) @@ -4457,7 +4561,7 @@ def provider_get_name(provider: Provider) -> str: Get a copy of this provider's name. [Rust - `pactffi_provider_get_name`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/provider/fn.pactffi_provider_get_name.html) + `pactffi_provider_get_name`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/provider/fn.pactffi_provider_get_name.html) The copy must be deleted with `pactffi_string_delete`. @@ -4503,7 +4607,7 @@ def pact_get_provider(pact: Pact) -> Provider: `pactffi_pact_provider_delete` when no longer required. [Rust - `pactffi_pact_get_provider`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/provider/fn.pactffi_pact_get_provider.html) + `pactffi_pact_get_provider`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/provider/fn.pactffi_pact_get_provider.html) # Errors @@ -4518,7 +4622,7 @@ def pact_provider_delete(provider: Provider) -> None: Frees the memory used by the Pact provider. [Rust - `pactffi_pact_provider_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/provider/fn.pactffi_pact_provider_delete.html) + `pactffi_pact_provider_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/provider/fn.pactffi_pact_provider_delete.html) """ raise NotImplementedError @@ -4528,7 +4632,7 @@ def provider_state_get_name(provider_state: ProviderState) -> str | None: Get the name of the provider state as a string. [Rust - `pactffi_provider_state_get_name`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/provider_state/fn.pactffi_provider_state_get_name.html) + `pactffi_provider_state_get_name`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/provider_state/fn.pactffi_provider_state_get_name.html) Raises: RuntimeError: @@ -4548,7 +4652,7 @@ def provider_state_get_param_iter( Get an iterator over the params of a provider state. [Rust - `pactffi_provider_state_get_param_iter`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/provider_state/fn.pactffi_provider_state_get_param_iter.html) + `pactffi_provider_state_get_param_iter`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/provider_state/fn.pactffi_provider_state_get_param_iter.html) # Safety @@ -4576,7 +4680,7 @@ def provider_state_param_iter_next( Get the next key and value out of the iterator, if possible. [Rust - `pactffi_provider_state_param_iter_next`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/provider_state/fn.pactffi_provider_state_param_iter_next.html) + `pactffi_provider_state_param_iter_next`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/provider_state/fn.pactffi_provider_state_param_iter_next.html) # Safety @@ -4597,7 +4701,7 @@ def provider_state_delete(provider_state: ProviderState) -> None: Free the provider state when you're done using it. [Rust - `pactffi_provider_state_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/provider_state/fn.pactffi_provider_state_delete.html) + `pactffi_provider_state_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/provider_state/fn.pactffi_provider_state_delete.html) """ raise NotImplementedError @@ -4607,7 +4711,7 @@ def provider_state_param_iter_delete(iter: ProviderStateParamIterator) -> None: Free the provider state param iterator when you're done using it. [Rust - `pactffi_provider_state_param_iter_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/provider_state/fn.pactffi_provider_state_param_iter_delete.html) + `pactffi_provider_state_param_iter_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/provider_state/fn.pactffi_provider_state_param_iter_delete.html) """ lib.pactffi_provider_state_param_iter_delete(iter._ptr) @@ -4617,7 +4721,7 @@ def provider_state_param_pair_delete(pair: ProviderStateParamPair) -> None: Free a pair of key and value. [Rust - `pactffi_provider_state_param_pair_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/provider_state/fn.pactffi_provider_state_param_pair_delete.html) + `pactffi_provider_state_param_pair_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/provider_state/fn.pactffi_provider_state_param_pair_delete.html) """ lib.pactffi_provider_state_param_pair_delete(pair._ptr) @@ -4627,7 +4731,7 @@ def sync_message_new() -> SynchronousMessage: Get a mutable pointer to a newly-created default message on the heap. [Rust - `pactffi_sync_message_new`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_new.html) + `pactffi_sync_message_new`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_new.html) # Safety @@ -4645,7 +4749,7 @@ def sync_message_delete(message: SynchronousMessage) -> None: Destroy the `Message` being pointed to. [Rust - `pactffi_sync_message_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_delete.html) + `pactffi_sync_message_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_delete.html) """ lib.pactffi_sync_message_delete(message._ptr) @@ -4655,7 +4759,7 @@ def sync_message_get_request_contents_str(message: SynchronousMessage) -> str: Get the request contents of a `SynchronousMessage` in string form. [Rust - `pactffi_sync_message_get_request_contents_str`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_request_contents_str.html) + `pactffi_sync_message_get_request_contents_str`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_request_contents_str.html) # Safety @@ -4682,7 +4786,7 @@ def sync_message_set_request_contents_str( Sets the request contents of the message. [Rust - `pactffi_sync_message_set_request_contents_str`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_set_request_contents_str.html) + `pactffi_sync_message_set_request_contents_str`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_set_request_contents_str.html) - `message` - the message to set the request contents for - `contents` - pointer to contents to copy from. Must be a valid @@ -4710,7 +4814,7 @@ def sync_message_get_request_contents_length(message: SynchronousMessage) -> int Get the length of the request contents of a `SynchronousMessage`. [Rust - `pactffi_sync_message_get_request_contents_length`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_request_contents_length.html) + `pactffi_sync_message_get_request_contents_length`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_request_contents_length.html) # Safety @@ -4729,7 +4833,7 @@ def sync_message_get_request_contents_bin(message: SynchronousMessage) -> bytes: Get the request contents of a `SynchronousMessage` as a bytes. [Rust - `pactffi_sync_message_get_request_contents_bin`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_request_contents_bin.html) + `pactffi_sync_message_get_request_contents_bin`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_request_contents_bin.html) # Safety @@ -4756,7 +4860,7 @@ def sync_message_set_request_contents_bin( Sets the request contents of the message as an array of bytes. [Rust - `pactffi_sync_message_set_request_contents_bin`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_set_request_contents_bin.html) + `pactffi_sync_message_set_request_contents_bin`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_set_request_contents_bin.html) * `message` - the message to set the request contents for * `contents` - pointer to contents to copy from @@ -4783,7 +4887,7 @@ def sync_message_get_request_contents(message: SynchronousMessage) -> MessageCon Get the request contents of an `SynchronousMessage` as a `MessageContents`. [Rust - `pactffi_sync_message_get_request_contents`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_request_contents.html) + `pactffi_sync_message_get_request_contents`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_request_contents.html) # Safety @@ -4810,7 +4914,7 @@ def sync_message_generate_request_contents( contents as would be received by the consumer. [Rust - `pactffi_sync_message_generate_request_contents`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_generate_request_contents.html) + `pactffi_sync_message_generate_request_contents`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_generate_request_contents.html) Raises: RuntimeError: @@ -4828,7 +4932,7 @@ def sync_message_get_number_responses(message: SynchronousMessage) -> int: Get the number of response messages in the `SynchronousMessage`. [Rust - `pactffi_sync_message_get_number_responses`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_number_responses.html) + `pactffi_sync_message_get_number_responses`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_number_responses.html) If the message is null, this function will return 0. """ @@ -4843,7 +4947,7 @@ def sync_message_get_response_contents_str( Get the response contents of a `SynchronousMessage` in string form. [Rust - `pactffi_sync_message_get_response_contents_str`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_response_contents_str.html) + `pactffi_sync_message_get_response_contents_str`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_response_contents_str.html) # Safety @@ -4876,7 +4980,7 @@ def sync_message_set_response_contents_str( with default values. [Rust - `pactffi_sync_message_set_response_contents_str`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_set_response_contents_str.html) + `pactffi_sync_message_set_response_contents_str`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_set_response_contents_str.html) * `message` - the message to set the response contents for * `index` - index of the response to set. 0 is the first response. @@ -4908,7 +5012,7 @@ def sync_message_get_response_contents_length( Get the length of the response contents of a `SynchronousMessage`. [Rust - `pactffi_sync_message_get_response_contents_length`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_response_contents_length.html) + `pactffi_sync_message_get_response_contents_length`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_response_contents_length.html) # Safety @@ -4930,7 +5034,7 @@ def sync_message_get_response_contents_bin( Get the response contents of a `SynchronousMessage` as bytes. [Rust - `pactffi_sync_message_get_response_contents_bin`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_response_contents_bin.html) + `pactffi_sync_message_get_response_contents_bin`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_response_contents_bin.html) # Safety @@ -4961,7 +5065,7 @@ def sync_message_set_response_contents_bin( responses will be padded with default values. [Rust - `pactffi_sync_message_set_response_contents_bin`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_set_response_contents_bin.html) + `pactffi_sync_message_set_response_contents_bin`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_set_response_contents_bin.html) * `message` - the message to set the response contents for * `index` - index of the response to set. 0 is the first response @@ -4992,7 +5096,7 @@ def sync_message_get_response_contents( Get the response contents of an `SynchronousMessage` as a `MessageContents`. [Rust - `pactffi_sync_message_get_response_contents`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_response_contents.html) + `pactffi_sync_message_get_response_contents`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_response_contents.html) # Safety @@ -5021,7 +5125,7 @@ def sync_message_generate_response_contents( received by the consumer. [Rust - `pactffi_sync_message_generate_response_contents`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_generate_response_contents.html) + `pactffi_sync_message_generate_response_contents`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_generate_response_contents.html) Raises: RuntimeError: @@ -5039,7 +5143,7 @@ def sync_message_get_description(message: SynchronousMessage) -> str: Get a copy of the description. [Rust - `pactffi_sync_message_get_description`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_description.html) + `pactffi_sync_message_get_description`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_description.html) Raises: RuntimeError: @@ -5057,7 +5161,7 @@ def sync_message_set_description(message: SynchronousMessage, description: str) Write the `description` field on the `SynchronousMessage`. [Rust - `pactffi_sync_message_set_description`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_set_description.html) + `pactffi_sync_message_set_description`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_set_description.html) # Safety @@ -5082,7 +5186,7 @@ def sync_message_get_provider_state( Get a copy of the provider state at the given index from this message. [Rust - `pactffi_sync_message_get_provider_state`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_provider_state.html) + `pactffi_sync_message_get_provider_state`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_provider_state.html) # Safety @@ -5108,7 +5212,7 @@ def sync_message_get_provider_state_iter( Get an iterator over provider states. [Rust - `pactffi_sync_message_get_provider_state_iter`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_provider_state_iter.html) + `pactffi_sync_message_get_provider_state_iter`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_provider_state_iter.html) # Safety @@ -5130,7 +5234,7 @@ def string_delete(string: OwnedString) -> None: Delete a string previously returned by this FFI. [Rust - `pactffi_string_delete`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/fn.pactffi_string_delete.html) + `pactffi_string_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_string_delete.html) """ lib.pactffi_string_delete(string._ptr) @@ -5140,7 +5244,7 @@ def get_tls_ca_certificate() -> OwnedString: Fetch the CA Certificate used to generate the self-signed certificate. [Rust - `pactffi_get_tls_ca_certificate`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/fn.pactffi_get_tls_ca_certificate.html) + `pactffi_get_tls_ca_certificate`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/fn.pactffi_get_tls_ca_certificate.html) **NOTE:** The string for the result is allocated on the heap, and will have to be freed by the caller using [`string_delete`][pact_ffi.string_delete]. @@ -5163,7 +5267,7 @@ def create_mock_server_for_transport( Create a mock server for the provided Pact handle and transport. [Rust - `pactffi_create_mock_server_for_transport`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/fn.pactffi_create_mock_server_for_transport.html) + `pactffi_create_mock_server_for_transport`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/fn.pactffi_create_mock_server_for_transport.html) Args: pact: @@ -5229,7 +5333,7 @@ def mock_server_matched(mock_server_handle: PactServerHandle) -> bool: if any request has not been successfully matched, or the method panics. [Rust - `pactffi_mock_server_matched`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/fn.pactffi_mock_server_matched.html) + `pactffi_mock_server_matched`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/fn.pactffi_mock_server_matched.html) """ return lib.pactffi_mock_server_matched(mock_server_handle._ref) @@ -5241,7 +5345,7 @@ def mock_server_mismatches( External interface to get all the mismatches from a mock server. [Rust - `pactffi_mock_server_mismatches`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/fn.pactffi_mock_server_mismatches.html) + `pactffi_mock_server_mismatches`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/fn.pactffi_mock_server_mismatches.html) # Errors @@ -5268,7 +5372,7 @@ def cleanup_mock_server(mock_server_handle: PactServerHandle) -> None: and cleanup any memory allocated for it. [Rust - `pactffi_cleanup_mock_server`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/fn.pactffi_cleanup_mock_server.html) + `pactffi_cleanup_mock_server`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/fn.pactffi_cleanup_mock_server.html) Args: mock_server_handle: @@ -5297,7 +5401,7 @@ def write_pact_file( directory to write the file to is passed as the second parameter. [Rust - `pactffi_write_pact_file`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/fn.pactffi_write_pact_file.html) + `pactffi_write_pact_file`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/fn.pactffi_write_pact_file.html) Args: mock_server_handle: @@ -5349,7 +5453,7 @@ def mock_server_logs(mock_server_handle: PactServerHandle) -> str: started. [Rust - `pactffi_mock_server_logs`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/fn.pactffi_mock_server_logs.html) + `pactffi_mock_server_logs`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/fn.pactffi_mock_server_logs.html) Raises: RuntimeError: @@ -5373,7 +5477,7 @@ def generate_datetime_string(format: str) -> StringResult: string needs to be freed with the `pactffi_string_delete` function [Rust - `pactffi_generate_datetime_string`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/fn.pactffi_generate_datetime_string.html) + `pactffi_generate_datetime_string`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/fn.pactffi_generate_datetime_string.html) # Safety @@ -5390,7 +5494,7 @@ def check_regex(regex: str, example: str) -> bool: Checks that the example string matches the given regex. [Rust - `pactffi_check_regex`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/fn.pactffi_check_regex.html) + `pactffi_check_regex`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/fn.pactffi_check_regex.html) # Safety @@ -5409,7 +5513,7 @@ def generate_regex_value(regex: str) -> StringResult: `pactffi_string_delete` function. [Rust - `pactffi_generate_regex_value`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/fn.pactffi_generate_regex_value.html) + `pactffi_generate_regex_value`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/fn.pactffi_generate_regex_value.html) # Safety @@ -5424,7 +5528,7 @@ def free_string(s: str) -> None: [DEPRECATED] Frees the memory allocated to a string by another function. [Rust - `pactffi_free_string`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/fn.pactffi_free_string.html) + `pactffi_free_string`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/fn.pactffi_free_string.html) This function is deprecated. Use `pactffi_string_delete` instead. @@ -5446,7 +5550,7 @@ def new_pact(consumer_name: str, provider_name: str) -> PactHandle: Creates a new Pact model and returns a handle to it. [Rust - `pactffi_new_pact`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_new_pact.html) + `pactffi_new_pact`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_new_pact.html) Args: consumer_name: @@ -5499,7 +5603,7 @@ def new_interaction(pact: PactHandle, description: str) -> InteractionHandle: will result in that interaction being replaced with the new one. [Rust - `pactffi_new_interaction`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_new_interaction.html) + `pactffi_new_interaction`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_new_interaction.html) Args: pact: @@ -5527,7 +5631,7 @@ def new_message_interaction(pact: PactHandle, description: str) -> InteractionHa will result in that interaction being replaced with the new one. [Rust - `pactffi_new_message_interaction`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_new_message_interaction.html) + `pactffi_new_message_interaction`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_new_message_interaction.html) Args: pact: @@ -5558,7 +5662,7 @@ def new_sync_message_interaction( will result in that interaction being replaced with the new one. [Rust - `pactffi_new_sync_message_interaction`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_new_sync_message_interaction.html) + `pactffi_new_sync_message_interaction`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_new_sync_message_interaction.html) Args: pact: @@ -5583,7 +5687,7 @@ def upon_receiving(interaction: InteractionHandle, description: str) -> None: Sets the description for the Interaction. [Rust - `pactffi_upon_receiving`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_upon_receiving.html) + `pactffi_upon_receiving`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_upon_receiving.html) This function @@ -5624,7 +5728,7 @@ def given(interaction: InteractionHandle, description: str) -> None: Adds a provider state to the Interaction. [Rust - `pactffi_given`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_given.html) + `pactffi_given`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_given.html) Args: interaction: @@ -5651,7 +5755,7 @@ def interaction_test_name(interaction: InteractionHandle, test_name: str) -> Non used with V4 interactions. [Rust - `pactffi_interaction_test_name`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_interaction_test_name.html) + `pactffi_interaction_test_name`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_interaction_test_name.html) Args: interaction: @@ -5698,7 +5802,7 @@ def given_with_param( be parsed as JSON. [Rust - `pactffi_given_with_param`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_given_with_param.html) + `pactffi_given_with_param`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_given_with_param.html) Args: interaction: @@ -5740,7 +5844,7 @@ def given_with_params( with a `value` key. [Rust - `pactffi_given_with_params`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_given_with_params.html) + `pactffi_given_with_params`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_given_with_params.html) Args: interaction: @@ -5779,7 +5883,7 @@ def with_request(interaction: InteractionHandle, method: str, path: str) -> None Configures the request for the Interaction. [Rust - `pactffi_with_request`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_with_request.html) + `pactffi_with_request`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_request.html) Args: interaction: @@ -5793,7 +5897,7 @@ def with_request(interaction: InteractionHandle, method: str, path: str) -> None This may be a simple string in which case it will be used as-is, or it may be a [JSON matching - rule](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.8/rust/pact_ffi/IntegrationJson.md) + rule](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.10/rust/pact_ffi/IntegrationJson.md) which allows regex patterns. For examples: ```json @@ -5828,7 +5932,7 @@ def with_query_parameter_v2( Configures a query parameter for the Interaction. [Rust - `pactffi_with_query_parameter_v2`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_with_query_parameter_v2.html) + `pactffi_with_query_parameter_v2`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_query_parameter_v2.html) To setup a query parameter with multiple values, you can either call this function multiple times with a different index value: @@ -5865,7 +5969,7 @@ def with_query_parameter_v2( ) ``` - See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.8/rust/pact_ffi/IntegrationJson.md) + See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.10/rust/pact_ffi/IntegrationJson.md) If you want the matching rules to apply to all values (and not just the one with the given index), make sure to set the value to be an array. @@ -5917,7 +6021,7 @@ def with_query_parameter_v2( This may be a simple string in which case it will be used as-is, or it may be a [JSON matching - rule](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.8/rust/pact_ffi/IntegrationJson.md). + rule](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.10/rust/pact_ffi/IntegrationJson.md). Raises: RuntimeError: @@ -5939,7 +6043,7 @@ def with_specification(pact: PactHandle, version: PactSpecification) -> None: Sets the specification version for a given Pact model. [Rust - `pactffi_with_specification`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_with_specification.html) + `pactffi_with_specification`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_specification.html) Args: pact: @@ -5963,7 +6067,7 @@ def handle_get_pact_spec_version(handle: PactHandle) -> PactSpecification: Fetches the Pact specification version for the given Pact model. [Rust - `pactffi_handle_get_pact_spec_version`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_handle_get_pact_spec_version.html) + `pactffi_handle_get_pact_spec_version`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_handle_get_pact_spec_version.html) Args: handle: @@ -5989,7 +6093,7 @@ def with_pact_metadata( the mock server for it has already started) or the namespace is readonly. [Rust - `pactffi_with_pact_metadata`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_with_pact_metadata.html) + `pactffi_with_pact_metadata`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_pact_metadata.html) Args: pact: @@ -6055,7 +6159,7 @@ def with_metadata( ``` See - [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.8/rust/pact_ffi/IntegrationJson.md) + [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.10/rust/pact_ffi/IntegrationJson.md) # Note @@ -6104,7 +6208,7 @@ def with_header_v2( r""" Configures a header for the Interaction. - [Rust `pactffi_with_header_v2`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_with_header_v2.html) + [Rust `pactffi_with_header_v2`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_header_v2.html) To setup a header with multiple values, you can either call this function multiple times with a different index value: @@ -6142,7 +6246,7 @@ def with_header_v2( ) ``` - See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.8/rust/pact_ffi/IntegrationJson.md) + See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.10/rust/pact_ffi/IntegrationJson.md) Args: interaction: @@ -6164,7 +6268,7 @@ def with_header_v2( This may be a simple string in which case it will be used as-is, or it may be a [JSON matching - rule](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.8/rust/pact_ffi/IntegrationJson.md). + rule](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.10/rust/pact_ffi/IntegrationJson.md). Raises: RuntimeError: @@ -6196,7 +6300,7 @@ def set_header( and generators can not be configured with it. [Rust - `pactffi_set_header`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_set_header.html) + `pactffi_set_header`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_set_header.html) If matching rules are required to be set, use `pactffi_with_header_v2`. @@ -6234,7 +6338,7 @@ def response_status(interaction: InteractionHandle, status: int) -> None: Configures the response for the Interaction. [Rust - `pactffi_response_status`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_response_status.html) + `pactffi_response_status`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_response_status.html) Args: interaction: @@ -6258,7 +6362,7 @@ def response_status_v2(interaction: InteractionHandle, status: str) -> None: Configures the response for the Interaction. [Rust - `pactffi_response_status_v2`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_response_status_v2.html) + `pactffi_response_status_v2`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_response_status_v2.html) To include matching rules for the status (only statusCode or integer really makes sense to use), include the matching rule JSON format with the value as @@ -6277,7 +6381,7 @@ def response_status_v2(interaction: InteractionHandle, status: str) -> None: ) ``` - See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.8/rust/pact_ffi/IntegrationJson.md) + See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.10/rust/pact_ffi/IntegrationJson.md) Args: interaction: @@ -6288,7 +6392,7 @@ def response_status_v2(interaction: InteractionHandle, status: str) -> None: This may be a simple string in which case it will be used as-is, or it may be a [JSON matching - rule](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.8/rust/pact_ffi/IntegrationJson.md). + rule](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.10/rust/pact_ffi/IntegrationJson.md). Raises: RuntimeError: @@ -6312,7 +6416,7 @@ def with_body( Adds the body for the interaction. [Rust - `pactffi_with_body`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_with_body.html) + `pactffi_with_body`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_body.html) Returns false if the interaction or Pact can't be modified (i.e. the mock server for it has already started) @@ -6347,7 +6451,7 @@ def with_body( body: The body contents. For JSON payloads, matching rules can be embedded in the body. See - [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.8/rust/pact_ffi/IntegrationJson.md). + [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.10/rust/pact_ffi/IntegrationJson.md). Raises: RuntimeError: @@ -6374,7 +6478,7 @@ def with_binary_body( Adds the body for the interaction. [Rust - `pactffi_with_binary_body`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_with_binary_body.html) + `pactffi_with_binary_body`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_binary_body.html) For HTTP and async message interactions, this will overwrite the body. With asynchronous messages, the part parameter will be ignored. With synchronous @@ -6434,7 +6538,7 @@ def with_binary_file( already started) [Rust - `pactffi_with_binary_file`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_with_binary_file.html) + `pactffi_with_binary_file`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_binary_file.html) For HTTP and async message interactions, this will overwrite the body. With asynchronous messages, the part parameter will be ignored. With synchronous @@ -6481,7 +6585,7 @@ def with_matching_rules( Add matching rules to the interaction. [Rust - `pactffi_with_matching_rules`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_with_matching_rules.html) + `pactffi_with_matching_rules`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_matching_rules.html) This function can be called multiple times, in which case the matching rules will be merged. @@ -6519,7 +6623,7 @@ def with_generators( Add generators to the interaction. [Rust - `pactffi_with_generators`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_with_generators.html) + `pactffi_with_generators`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_generators.html) This function can be called multiple times, in which case the generators will be combined (provide they don't clash). @@ -6567,7 +6671,7 @@ def with_multipart_file_v2( # noqa: PLR0913, PLR0917 already started) or an error occurs. [Rust - `pactffi_with_multipart_file_v2`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_with_multipart_file_v2.html) + `pactffi_with_multipart_file_v2`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_multipart_file_v2.html) This function can be called multiple times. In that case, each subsequent call will be appended to the existing multipart body as a new part. @@ -6621,7 +6725,7 @@ def with_multipart_file( already started) or an error occurs. [Rust - `pactffi_with_multipart_file`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_with_multipart_file.html) + `pactffi_with_multipart_file`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_multipart_file.html) * `interaction` - Interaction handle to set the body for. * `part` - Request or response part. @@ -6658,7 +6762,7 @@ def set_key(interaction: InteractionHandle, key: str | None) -> None: Sets the key attribute for the interaction. [Rust - `pactffi_set_key`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_set_key.html) + `pactffi_set_key`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_set_key.html) Args: interaction: @@ -6686,7 +6790,7 @@ def set_pending(interaction: InteractionHandle, *, pending: bool) -> None: Mark the interaction as pending. [Rust - `pactffi_set_pending`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_set_pending.html) + `pactffi_set_pending`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_set_pending.html) Args: interaction: @@ -6710,7 +6814,7 @@ def set_comment(interaction: InteractionHandle, key: str, value: str | None) -> Add a comment to the interaction. [Rust - `pactffi_set_comment`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_set_comment.html) + `pactffi_set_comment`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_set_comment.html) Args: interaction: @@ -6744,7 +6848,7 @@ def add_text_comment(interaction: InteractionHandle, comment: str) -> None: Add a text comment to the interaction. [Rust - `pactffi_add_text_comment`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_add_text_comment.html) + `pactffi_add_text_comment`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_add_text_comment.html) Args: interaction: @@ -6781,7 +6885,7 @@ def add_interaction_reference( reference, or a pull request reference. [Rust - `pactffi_add_interaction_reference`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_add_interaction_reference.html) + `pactffi_add_interaction_reference`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_add_interaction_reference.html) Args: interaction: @@ -6837,7 +6941,7 @@ def pact_handle_get_async_message_iter(pact: PactHandle) -> PactAsyncMessageIter `pactffi_pact_sync_message_iter_delete`. [Rust - `pactffi_pact_handle_get_sync_message_iter`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_pact_handle_get_sync_message_iter.html) + `pactffi_pact_handle_get_sync_message_iter`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_pact_handle_get_sync_message_iter.html) # Safety @@ -6863,7 +6967,7 @@ def pact_handle_get_sync_message_iter(pact: PactHandle) -> PactSyncMessageIterat `pactffi_pact_sync_message_iter_delete`. [Rust - `pactffi_pact_handle_get_sync_message_iter`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_pact_handle_get_sync_message_iter.html) + `pactffi_pact_handle_get_sync_message_iter`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_pact_handle_get_sync_message_iter.html) # Safety @@ -6889,7 +6993,7 @@ def pact_handle_get_sync_http_iter(pact: PactHandle) -> PactSyncHttpIterator: `pactffi_pact_sync_http_iter_delete`. [Rust - `pactffi_pact_handle_get_sync_http_iter`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_pact_handle_get_sync_http_iter.html) + `pactffi_pact_handle_get_sync_http_iter`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_pact_handle_get_sync_http_iter.html) # Safety @@ -6913,7 +7017,7 @@ def pact_handle_get_message_iter(pact: PactHandle) -> PactMessageIterator: `pactffi_pact_message_iter_delete`. [Rust - `pactffi_pact_handle_get_message_iter`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_pact_handle_get_message_iter.html) + `pactffi_pact_handle_get_message_iter`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_pact_handle_get_message_iter.html) # Safety @@ -6931,6 +7035,38 @@ def pact_handle_get_message_iter(pact: PactHandle) -> PactMessageIterator: ) +def sync_message_generate_contents(interaction: InteractionHandle) -> dict[str, Any]: + """ + Get the generated contents of a synchronous message interaction. + + Any generators configured on the request and responses are applied, giving + the values a consumer would actually see. The matching rules and generators + are omitted from the result. + + [Rust + `pactffi_sync_message_generate_contents`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_sync_message_generate_contents.html) + + Args: + interaction: + Handle to a synchronous message interaction. + + Returns: + The interaction in the V4 Pact JSON format, with the request under + `request` and the list of responses under `response`. + + Raises: + RuntimeError: + If the handle does not refer to a synchronous message interaction. + """ + contents = OwnedString( + lib.pactffi_sync_message_generate_contents(interaction._ref), + ) + if not contents: + msg = f"{interaction} is not a synchronous message interaction." + raise RuntimeError(msg) + return json.loads(contents) + + def pact_handle_write_file( pact: PactHandle, directory: Path | str | None, @@ -6941,7 +7077,7 @@ def pact_handle_write_file( External interface to write out the pact file. [Rust - `pactffi_pact_handle_write_file`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_pact_handle_write_file.html) + `pactffi_pact_handle_write_file`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_pact_handle_write_file.html) This function should be called if all the consumer tests have passed. @@ -6985,7 +7121,7 @@ def free_pact_handle(pact: PactHandle) -> None: Delete a Pact handle and free the resources used by it. [Rust - `pactffi_free_pact_handle`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/mock_server/handles/fn.pactffi_free_pact_handle.html) + `pactffi_free_pact_handle`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_free_pact_handle.html) Raises: RuntimeError: @@ -7011,7 +7147,7 @@ def verifier_new_for_application() -> VerifierHandle: to set the required values and enable it. [Rust - `pactffi_verifier_new_for_application`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_new_for_application.html) + `pactffi_verifier_new_for_application`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_new_for_application.html) """ result: cffi.FFI.CData = lib.pactffi_verifier_new_for_application( b"pact-python", @@ -7024,7 +7160,7 @@ def verifier_shutdown(handle: VerifierHandle) -> None: """ Shutdown the verifier and release all resources. - [Rust `pactffi_verifier_shutdown`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_shutdown.html) + [Rust `pactffi_verifier_shutdown`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_shutdown.html) """ lib.pactffi_verifier_shutdown(handle._ref) @@ -7041,7 +7177,7 @@ def verifier_set_provider_info( # noqa: PLR0913, PLR0917 Set the provider details for the Pact verifier. [Rust - `pactffi_verifier_set_provider_info`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_set_provider_info.html) + `pactffi_verifier_set_provider_info`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_set_provider_info.html) Args: handle: @@ -7087,7 +7223,7 @@ def verifier_add_provider_transport( Adds a new transport for the given provider. [Rust - `pactffi_verifier_add_provider_transport`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_add_provider_transport.html) + `pactffi_verifier_add_provider_transport`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_add_provider_transport.html) Args: handle: @@ -7128,7 +7264,7 @@ def verifier_set_filter_info( Set the filters for the Pact verifier. [Rust - `pactffi_verifier_set_filter_info`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_set_filter_info.html) + `pactffi_verifier_set_filter_info`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_set_filter_info.html) Set filters to narrow down the interactions to verify. @@ -7164,7 +7300,7 @@ def verifier_set_provider_state( Set the provider state URL for the Pact verifier. [Rust - `pactffi_verifier_set_provider_state`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_set_provider_state.html) + `pactffi_verifier_set_provider_state`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_set_provider_state.html) Args: handle: @@ -7199,7 +7335,7 @@ def verifier_set_verification_options( Set the options used by the verifier when calling the provider. [Rust - `pactffi_verifier_set_verification_options`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_set_verification_options.html) + `pactffi_verifier_set_verification_options`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_set_verification_options.html) Args: handle: @@ -7234,7 +7370,7 @@ def verifier_set_coloured_output( Enables or disables coloured output using ANSI escape codes. [Rust - `pactffi_verifier_set_coloured_output`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_set_coloured_output.html) + `pactffi_verifier_set_coloured_output`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_set_coloured_output.html) By default, coloured output is enabled. @@ -7263,7 +7399,7 @@ def verifier_set_no_pacts_is_error(handle: VerifierHandle, *, enabled: bool) -> Enables or disables if no pacts are found to verify results in an error. [Rust - `pactffi_verifier_set_no_pacts_is_error`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_set_no_pacts_is_error.html) + `pactffi_verifier_set_no_pacts_is_error`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_set_no_pacts_is_error.html) Args: handle: @@ -7296,7 +7432,7 @@ def verifier_set_publish_options( Set the options used when publishing verification results to the Broker. [Rust - `pactffi_verifier_set_publish_options`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_set_publish_options.html) + `pactffi_verifier_set_publish_options`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_set_publish_options.html) Args: handle: @@ -7339,7 +7475,7 @@ def verifier_set_consumer_filters( Set the consumer filters for the Pact verifier. [Rust - `pactffi_verifier_set_consumer_filters`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_set_consumer_filters.html) + `pactffi_verifier_set_consumer_filters`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_set_consumer_filters.html) """ lib.pactffi_verifier_set_consumer_filters( handle._ref, @@ -7357,7 +7493,7 @@ def verifier_add_custom_header( Adds a custom header to be added to the requests made to the provider. [Rust - `pactffi_verifier_add_custom_header`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_add_custom_header.html) + `pactffi_verifier_add_custom_header`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_add_custom_header.html) """ lib.pactffi_verifier_add_custom_header( handle._ref, @@ -7375,7 +7511,7 @@ def verifier_set_follow_redirects( Sets whether redirects should be automatically followed. [Rust - `pactffi_verifier_set_follow_redirects`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_set_follow_redirects.html) + `pactffi_verifier_set_follow_redirects`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_set_follow_redirects.html) Args: handle: @@ -7396,7 +7532,7 @@ def verifier_add_file_source(handle: VerifierHandle, file: str) -> None: Adds a Pact file as a source to verify. [Rust - `pactffi_verifier_add_file_source`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_add_file_source.html) + `pactffi_verifier_add_file_source`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_add_file_source.html) """ lib.pactffi_verifier_add_file_source(handle._ref, file.encode("utf-8")) @@ -7408,7 +7544,7 @@ def verifier_add_directory_source(handle: VerifierHandle, directory: str) -> Non All pacts from the directory that match the provider name will be verified. [Rust - `pactffi_verifier_add_directory_source`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_add_directory_source.html) + `pactffi_verifier_add_directory_source`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_add_directory_source.html) # Safety @@ -7430,7 +7566,7 @@ def verifier_url_source( Adds a URL as a source to verify. [Rust - `pactffi_verifier_url_source`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_url_source.html) + `pactffi_verifier_url_source`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_url_source.html) Args: handle: @@ -7470,7 +7606,7 @@ def verifier_broker_source( Adds a Pact broker as a source to verify. [Rust - `pactffi_verifier_broker_source`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_broker_source.html) + `pactffi_verifier_broker_source`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_broker_source.html) This will fetch all the pact files from the broker that match the provider name. @@ -7518,7 +7654,7 @@ def verifier_broker_source_with_selectors( # noqa: PLR0913, PLR0917 Adds a Pact broker as a source to verify. [Rust - `pactffi_verifier_broker_source_with_selectors`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_broker_source_with_selectors.html) + `pactffi_verifier_broker_source_with_selectors`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_broker_source_with_selectors.html) This will fetch all the pact files from the broker that match the provider name and the consumer version selectors (See [Consumer Version @@ -7598,7 +7734,7 @@ def verifier_execute(handle: VerifierHandle) -> None: Runs the verification. [Rust - `pactffi_verifier_execute`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_execute.html) + `pactffi_verifier_execute`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_execute.html) Raises: RuntimeError: @@ -7615,7 +7751,7 @@ def verifier_logs(handle: VerifierHandle) -> OwnedString: Extracts the logs for the verification run. [Rust - `pactffi_verifier_logs`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_logs.html) + `pactffi_verifier_logs`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_logs.html) This needs the memory buffer log sink to be setup before the verification is executed. The returned string will need to be freed with the `free_string` @@ -7637,7 +7773,7 @@ def verifier_logs_for_provider(provider_name: str) -> OwnedString: Extracts the logs for the verification run for the provider name. [Rust - `pactffi_verifier_logs_for_provider`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_logs_for_provider.html) + `pactffi_verifier_logs_for_provider`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_logs_for_provider.html) This needs the memory buffer log sink to be setup before the verification is executed. The returned string will need to be freed with the `free_string` @@ -7659,7 +7795,7 @@ def verifier_output(handle: VerifierHandle, strip_ansi: int) -> OwnedString: Extracts the standard output for the verification run. [Rust - `pactffi_verifier_output`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_output.html) + `pactffi_verifier_output`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_output.html) Args: handle: @@ -7686,7 +7822,7 @@ def verifier_json(handle: VerifierHandle) -> OwnedString: Extracts the verification result as a JSON document. [Rust - `pactffi_verifier_json`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/verifier/fn.pactffi_verifier_json.html) + `pactffi_verifier_json`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_json.html) The document has the attributes `result` (overall pass/fail), `notices`, `output` (the verification output lines), `errors`, `pendingErrors` and @@ -7723,7 +7859,7 @@ def using_plugin_with_delay( afterwards by calling [`cleanup_plugins`][pact_ffi.cleanup_plugins] otherwise you will have plugin processes left running. - [Rust `pactffi_using_plugin_with_delay`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/plugins/fn.pactffi_using_plugin_with_delay.html) + [Rust `pactffi_using_plugin_with_delay`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/plugins/fn.pactffi_using_plugin_with_delay.html) Args: pact: @@ -7778,7 +7914,7 @@ def using_plugin( otherwise you will have plugin processes left running. [Rust - `pactffi_using_plugin`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/plugins/fn.pactffi_using_plugin.html) + `pactffi_using_plugin`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/plugins/fn.pactffi_using_plugin.html) Args: pact: @@ -7821,7 +7957,7 @@ def cleanup_plugins(pact: PactHandle) -> None: zero). [Rust - `pactffi_cleanup_plugins`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/plugins/fn.pactffi_cleanup_plugins.html) + `pactffi_cleanup_plugins`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/plugins/fn.pactffi_cleanup_plugins.html) """ lib.pactffi_cleanup_plugins(pact._ref) @@ -7834,7 +7970,7 @@ def set_test_run_id(test_run_id: str | None) -> None: plugin log entries can be correlated with a specific test. [Rust - `pactffi_set_test_run_id`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/plugins/fn.pactffi_set_test_run_id.html) + `pactffi_set_test_run_id`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/plugins/fn.pactffi_set_test_run_id.html) Args: test_run_id: @@ -7847,8 +7983,7 @@ def set_test_run_id(test_run_id: str | None) -> None: # The CFFI callback must outlive the registration, as the Pact library holds a -# raw function pointer to it. The module-level reference is only released when -# a new callback replaces it. +# raw function pointer to it. _plugin_log_callback: Callable[..., None] | None = None @@ -7861,25 +7996,22 @@ def register_plugin_log_callback(callback: PluginLogCallback | None) -> None: be thread-safe, and it must not call back into the Pact FFI. Registering a new callback replaces any previously registered one. - - Plugin log entries are only captured once the library has been initialised - with [`init`][pact_ffi.init] or - [`init_with_log_level`][pact_ffi.init_with_log_level]; the `log_to_*` - functions do not install the plugin log sink. + Registering also installs the plugin log sink, so plugin log entries are + captured from this point whether or not a logger has been applied. [Rust - `pactffi_register_plugin_log_callback`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/plugins/fn.pactffi_register_plugin_log_callback.html) + `pactffi_register_plugin_log_callback`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/plugins/fn.pactffi_register_plugin_log_callback.html) Args: callback: The callback to invoke, or `None` to deregister the current - callback. Note that the underlying library currently ignores a - `NULL` registration, so the previous callback remains active. + callback. """ global _plugin_log_callback # noqa: PLW0603 if callback is None: lib.pactffi_register_plugin_log_callback(ffi.NULL) + _plugin_log_callback = None return def _decode(ptr: cffi.FFI.CData) -> str: @@ -7901,8 +8033,9 @@ def _callback( _decode(message), ) - _plugin_log_callback = ffi.callback("PluginLogCallback", _callback) - lib.pactffi_register_plugin_log_callback(_plugin_log_callback) + new_callback = ffi.callback("PluginLogCallback", _callback) + lib.pactffi_register_plugin_log_callback(new_callback) + _plugin_log_callback = new_callback def get_plugin_logs(plugin_instance_id: str) -> list[dict[str, Any]]: @@ -7912,12 +8045,13 @@ def get_plugin_logs(plugin_instance_id: str) -> list[dict[str, Any]]: Every plugin log entry is buffered by the Pact library, whether or not a callback has been registered with [`register_plugin_log_callback`][pact_ffi.register_plugin_log_callback]. - Entries are only captured once the library has been initialised with - [`init`][pact_ffi.init] or - [`init_with_log_level`][pact_ffi.init_with_log_level]. + Entries are only captured once the plugin log sink is installed, either by + applying a logger (with [`init`][pact_ffi.init], + [`init_with_log_level`][pact_ffi.init_with_log_level] or one of the + `log_to_*` functions) or by registering a plugin log callback. [Rust - `pactffi_get_plugin_logs`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/plugins/fn.pactffi_get_plugin_logs.html) + `pactffi_get_plugin_logs`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/plugins/fn.pactffi_get_plugin_logs.html) Args: plugin_instance_id: @@ -7953,7 +8087,7 @@ def interaction_contents( format of the JSON contents. [Rust - `pactffi_interaction_contents`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/plugins/fn.pactffi_interaction_contents.html) + `pactffi_interaction_contents`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/plugins/fn.pactffi_interaction_contents.html) Args: interaction: @@ -8013,7 +8147,7 @@ def matches_string_value( function once it is no longer required. [Rust - `pactffi_matches_string_value`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/matching/fn.pactffi_matches_string_value.html) + `pactffi_matches_string_value`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/matching/fn.pactffi_matches_string_value.html) * matching_rule - pointer to a matching rule * expected_value - value we expect to get as a NULL terminated string @@ -8044,7 +8178,7 @@ def matches_u64_value( function once it is no longer required. [Rust - `pactffi_matches_u64_value`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/matching/fn.pactffi_matches_u64_value.html) + `pactffi_matches_u64_value`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/matching/fn.pactffi_matches_u64_value.html) * matching_rule - pointer to a matching rule * expected_value - value we expect to get @@ -8074,7 +8208,7 @@ def matches_i64_value( function once it is no longer required. [Rust - `pactffi_matches_i64_value`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/matching/fn.pactffi_matches_i64_value.html) + `pactffi_matches_i64_value`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/matching/fn.pactffi_matches_i64_value.html) * matching_rule - pointer to a matching rule * expected_value - value we expect to get @@ -8104,7 +8238,7 @@ def matches_f64_value( function once it is no longer required. [Rust - `pactffi_matches_f64_value`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/matching/fn.pactffi_matches_f64_value.html) + `pactffi_matches_f64_value`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/matching/fn.pactffi_matches_f64_value.html) * matching_rule - pointer to a matching rule * expected_value - value we expect to get @@ -8134,7 +8268,7 @@ def matches_bool_value( function once it is no longer required. [Rust - `pactffi_matches_bool_value`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/matching/fn.pactffi_matches_bool_value.html) + `pactffi_matches_bool_value`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/matching/fn.pactffi_matches_bool_value.html) * matching_rule - pointer to a matching rule * expected_value - value we expect to get, 0 == false and 1 == true @@ -8166,7 +8300,7 @@ def matches_binary_value( # noqa: PLR0913, PLR0917 function once it is no longer required. [Rust - `pactffi_matches_binary_value`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/matching/fn.pactffi_matches_binary_value.html) + `pactffi_matches_binary_value`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/matching/fn.pactffi_matches_binary_value.html) * matching_rule - pointer to a matching rule * expected_value - value we expect to get @@ -8201,7 +8335,7 @@ def matches_json_value( function once it is no longer required. [Rust - `pactffi_matches_json_value`](https://docs.rs/pact_ffi/0.5.8/pact_ffi/matching/fn.pactffi_matches_json_value.html) + `pactffi_matches_json_value`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/matching/fn.pactffi_matches_json_value.html) * matching_rule - pointer to a matching rule * expected_value - value we expect to get as a NULL terminated string diff --git a/pact-python-ffi/tests/test_init.py b/pact-python-ffi/tests/test_init.py index efd6863fb..39aecb5ab 100644 --- a/pact-python-ffi/tests/test_init.py +++ b/pact-python-ffi/tests/test_init.py @@ -13,7 +13,11 @@ from __future__ import annotations +import json import re +import subprocess +import sys +import textwrap import pytest @@ -259,3 +263,68 @@ def test_synchronous_message_casting(self, pact: pact_ffi.PactHandle) -> None: interaction.as_synchronous_http() with pytest.raises(TypeError): interaction.as_asynchronous_message() + + +def test_sync_message_generate_contents() -> None: + pact = pact_ffi.new_pact("consumer", "provider") + interaction = pact_ffi.new_sync_message_interaction(pact, "sync") + pact_ffi.with_body( + interaction, + pact_ffi.InteractionPart.REQUEST, + "application/json", + json.dumps({ + "id": { + "value": 100, + "pact:matcher:type": "integer", + "pact:generator:type": "RandomInt", + "min": 1, + "max": 99, + } + }), + ) + pact_ffi.with_body( + interaction, + pact_ffi.InteractionPart.RESPONSE, + "application/json", + json.dumps({"result": "ok"}), + ) + + contents = pact_ffi.sync_message_generate_contents(interaction) + + assert 1 <= contents["request"]["contents"]["content"]["id"] <= 99 + assert "matchingRules" not in contents["request"] + assert "generators" not in contents["request"] + assert contents["response"][0]["contents"]["content"] == {"result": "ok"} + + +def test_sync_message_generate_contents_http() -> None: + pact = pact_ffi.new_pact("consumer", "provider") + interaction = pact_ffi.new_interaction(pact, "http") + with pytest.raises(RuntimeError, match="not a synchronous message"): + pact_ffi.sync_message_generate_contents(interaction) + + +def test_log_callback() -> None: + # Applying a logger installs a process-wide subscriber, so the test runs in + # a separate interpreter. + script = textwrap.dedent( + """ + import pact_ffi + + events = [] + pact_ffi.set_log_callback_level("INFO") + pact_ffi.register_log_callback(lambda *args: events.append(args)) + pact_ffi.log_to_buffer("ERROR") + pact_ffi.log_message("received", "INFO", "test") + pact_ffi.register_log_callback(None) + pact_ffi.log_message("dropped", "INFO", "test") + print([e[2:] for e in events]) + """ + ) + result = subprocess.run( # noqa: S603 + [sys.executable, "-c", script], + capture_output=True, + check=True, + text=True, + ) + assert result.stdout.strip() == "[('INFO', 'pact_ffi', 'received source=test')]" From bf003c18afec11cff0aa0acd350f74904a3f7d34 Mon Sep 17 00:00:00 2001 From: JP-Ellis Date: Thu, 15 Oct 2026 12:39:57 +1100 Subject: [PATCH 2/3] docs(ffi): remove duplicated docstring sections The `add_interaction_reference` docstring had a second, terser `Args:` section. The `StringResult.raise_exception` docstring repeated its `Raises:` section. Signed-off-by: JP-Ellis Assisted-by: Claude Code:claude-opus-5-5 --- pact-python-ffi/src/pact_ffi/__init__.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/pact-python-ffi/src/pact_ffi/__init__.py b/pact-python-ffi/src/pact_ffi/__init__.py index bc885810c..dc740ade9 100644 --- a/pact-python-ffi/src/pact_ffi/__init__.py +++ b/pact-python-ffi/src/pact_ffi/__init__.py @@ -2010,10 +2010,6 @@ def raise_exception(self) -> None: """ Raise an exception with the text of the result. - Raises: - RuntimeError: - If the result is an error. - Raises: RuntimeError: If the result is an error. @@ -6903,21 +6899,6 @@ def add_interaction_reference( Value of the reference, typically an ID (e.g., `"TICKET-123"`, `"getUserById"`, `"#123"`). - - - Args: - interaction: - Interaction handle to modify. - - group: - Group or system the reference belongs to (e.g. ``"Jira"``). - - name: - Name or identifier of the reference (e.g. ``"TICKET-123"``). - - value: - Value of the reference, typically an ID. - Raises: RuntimeError: If the reference could not be added. From d8dcc765f292699c385fb8c4f677915505dedcb4 Mon Sep 17 00:00:00 2001 From: "pact-foundation[bot]" <289648111+pact-foundation[bot]@users.noreply.github.com> Date: Thu, 15 Oct 2026 01:31:47 +0000 Subject: [PATCH 3/3] chore(release): pact-python-ffi v0.5.10.0 Assisted-by: Claude Code:claude-opus-5-5 --- pact-python-ffi/CHANGELOG.md | 20 ++++++++++++++++++++ pact-python-ffi/pyproject.toml | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/pact-python-ffi/CHANGELOG.md b/pact-python-ffi/CHANGELOG.md index 5a630182b..008de83be 100644 --- a/pact-python-ffi/CHANGELOG.md +++ b/pact-python-ffi/CHANGELOG.md @@ -8,6 +8,26 @@ Note that this _only_ includes changes to the Python FFI interface. For changes +## [pact-python-ffi/0.5.10.0] _2026-10-15_ + +### 🚀 Features + +- [**breaking**] Remove pact.v2 compatibility module + > `pact.v2`, the `compat-v2` extra and the `pact-verifier` console script are removed. Migrate to the `pact` API (see MIGRATION.md) or pin `pact-python<4`. +- Update bindings to Pact FFI 0.5.10 + +### 📚 Documentation + +- _(ffi)_ Remove duplicated docstring sections + +### ⚙️ Miscellaneous Tasks + +- Require python 3.11 or newer + +### Contributors + +- @JP-Ellis + ## [pact-python-ffi/0.5.8.0] _2026-09-17_ ### 🚀 Features diff --git a/pact-python-ffi/pyproject.toml b/pact-python-ffi/pyproject.toml index 068e3ec52..8e3a5788c 100644 --- a/pact-python-ffi/pyproject.toml +++ b/pact-python-ffi/pyproject.toml @@ -2,7 +2,7 @@ [project] name = "pact-python-ffi" -version = "0.5.8.0" +version = "0.5.10.0" description = "Python bindings for the Pact FFI library" readme = "README.md" license = "MIT"