diff --git a/pact-python-ffi/CHANGELOG.md b/pact-python-ffi/CHANGELOG.md index 008de83be..aef17bb17 100644 --- a/pact-python-ffi/CHANGELOG.md +++ b/pact-python-ffi/CHANGELOG.md @@ -8,6 +8,28 @@ Note that this _only_ includes changes to the Python FFI interface. For changes +## [pact-python-ffi/0.5.12.0] _2026-10-21_ + +### 🚀 Features + +- Update bindings to Pact FFI 0.5.12 + +### 🐛 Bug Fixes + +- _(ffi)_ Keep `ffi` and `__version__` bound under lazy imports + +### ⚡ Performance + +- _(ffi)_ Write the version file at build time + +### ⚙️ Miscellaneous Tasks + +- _(ffi)_ Download pact_ffi from the dist-built release + +### Contributors + +- @JP-Ellis + ## [pact-python-ffi/0.5.10.0] _2026-10-15_ ### 🚀 Features diff --git a/pact-python-ffi/hatch_build.py b/pact-python-ffi/hatch_build.py index 94f256eff..95597c3e2 100644 --- a/pact-python-ffi/hatch_build.py +++ b/pact-python-ffi/hatch_build.py @@ -412,46 +412,36 @@ def _patch_header(self, source: str) -> str: """ Patch the upstream header so that CFFI can compile it. - 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. + The upstream `pact.h` emits the callback parameter of + `pactffi_register_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. Args: source: The contents of the upstream `pact.h`. Returns: - The header contents with the callbacks declared as function - pointers. + The header contents with the callback declared as a function + pointer. """ - 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 + opaque = "typedef struct Option_LogCallback Option_LogCallback;" + if opaque not in source: + return source + self.app.display_debug("Patching Option_LogCallback in pact.h") + return source.replace( + opaque, + "typedef void (*LogCallback)(" + "const char *log_id, " + "const char *test_run_id, " + "const char *level, " + "const char *target, " + "const char *message);", + ).replace( + "void pactffi_register_log_callback(struct Option_LogCallback callback);", + "void pactffi_register_log_callback(LogCallback callback);", + ) 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 3a3bbbf50..93a4af9e6 100644 --- a/pact-python-ffi/src/pact_ffi/__init__.py +++ b/pact-python-ffi/src/pact_ffi/__init__.py @@ -447,7 +447,7 @@ class InteractionHandle: Handle to a HTTP Interaction. [Rust - `InteractionHandle`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/struct.InteractionHandle.html) + `InteractionHandle`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/struct.InteractionHandle.html) """ def __init__(self, ref: int) -> None: @@ -947,7 +947,7 @@ class PactHandle: Handle to a Pact. [Rust - `PactHandle`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/struct.PactHandle.html) + `PactHandle`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/struct.PactHandle.html) """ def __init__(self, ref: int) -> None: @@ -1730,7 +1730,7 @@ class VerifierHandle: """ Handle to a Verifier. - [Rust `VerifierHandle`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/handle/struct.VerifierHandle.html) + [Rust `VerifierHandle`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/handle/struct.VerifierHandle.html) """ def __init__(self, ref: cffi.FFI.CData) -> None: @@ -1766,7 +1766,7 @@ class ExpressionValueType(Enum): """ Expression Value Type. - [Rust `ExpressionValueType`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/expressions/enum.ExpressionValueType.html) + [Rust `ExpressionValueType`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/expressions/enum.ExpressionValueType.html) """ UNKNOWN = lib.ExpressionValueType_Unknown @@ -1793,7 +1793,7 @@ class GeneratorCategory(Enum): """ Generator Category. - [Rust `GeneratorCategory`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/generators/enum.GeneratorCategory.html) + [Rust `GeneratorCategory`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/generators/enum.GeneratorCategory.html) """ METHOD = lib.GeneratorCategory_METHOD @@ -1821,7 +1821,7 @@ class InteractionPart(Enum): """ Interaction Part. - [Rust `InteractionPart`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/enum.InteractionPart.html) + [Rust `InteractionPart`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/enum.InteractionPart.html) """ REQUEST = lib.InteractionPart_Request @@ -1867,7 +1867,7 @@ class MatchingRuleCategory(Enum): """ Matching Rule Category. - [Rust `MatchingRuleCategory`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/matching_rules/enum.MatchingRuleCategory.html) + [Rust `MatchingRuleCategory`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/matching_rules/enum.MatchingRuleCategory.html) """ METHOD = lib.MatchingRuleCategory_METHOD @@ -1896,7 +1896,7 @@ class PactSpecification(Enum): """ Pact Specification. - [Rust `PactSpecification`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/pact_specification/enum.PactSpecification.html) + [Rust `PactSpecification`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/pact_specification/enum.PactSpecification.html) """ UNKNOWN = lib.PactSpecification_Unknown @@ -1949,7 +1949,7 @@ class _StringResult(Enum): """ Internal enum from Pact FFI. - [Rust `StringResult`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/enum.StringResult.html) + [Rust `StringResult`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/enum.StringResult.html) """ FAILED = lib.StringResult_Failed @@ -2110,7 +2110,7 @@ def version() -> str: """ Return the version of the pact_ffi library. - [Rust `pactffi_version`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_version.html) + [Rust `pactffi_version`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/fn.pactffi_version.html) Returns: The version of the pact_ffi library as a string, in the form of `x.y.z`. @@ -2133,7 +2133,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.10/pact_ffi/fn.pactffi_init.html) + `pactffi_init`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/fn.pactffi_init.html) Args: log_env_var: @@ -2153,7 +2153,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.10/pact_ffi/fn.pactffi_init_with_log_level.html) + `pactffi_init_with_log_level`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/fn.pactffi_init_with_log_level.html) Args: level: @@ -2169,7 +2169,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.10/pact_ffi/fn.pactffi_enable_ansi_support.html) + `pactffi_enable_ansi_support`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/fn.pactffi_enable_ansi_support.html) # Safety @@ -2187,7 +2187,7 @@ def log_message( Log using the shared core logging facility. [Rust - `pactffi_log_message`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_log_message.html) + `pactffi_log_message`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/fn.pactffi_log_message.html) This is useful for callers to have a single set of logs. @@ -2217,7 +2217,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.10/pact_ffi/fn.pactffi_mismatches_get_iter.html) + `pactffi_mismatches_get_iter`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/fn.pactffi_mismatches_get_iter.html) """ raise NotImplementedError @@ -2226,7 +2226,7 @@ def mismatches_delete(mismatches: Mismatches) -> None: """ Delete mismatches. - [Rust `pactffi_mismatches_delete`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_mismatches_delete.html) + [Rust `pactffi_mismatches_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/fn.pactffi_mismatches_delete.html) """ raise NotImplementedError @@ -2235,7 +2235,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.10/pact_ffi/fn.pactffi_mismatches_iter_next.html) + [Rust `pactffi_mismatches_iter_next`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/fn.pactffi_mismatches_iter_next.html) Returns a null pointer if no mismatches remain. """ @@ -2246,7 +2246,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.10/pact_ffi/fn.pactffi_mismatches_iter_delete.html) + [Rust `pactffi_mismatches_iter_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/fn.pactffi_mismatches_iter_delete.html) """ raise NotImplementedError @@ -2255,7 +2255,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.10/pact_ffi/fn.pactffi_mismatch_to_json.html) + [Rust `pactffi_mismatch_to_json`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/fn.pactffi_mismatch_to_json.html) """ raise NotImplementedError @@ -2264,7 +2264,7 @@ def mismatch_type(mismatch: Mismatch) -> str: """ Get the type of a mismatch. - [Rust `pactffi_mismatch_type`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_mismatch_type.html) + [Rust `pactffi_mismatch_type`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/fn.pactffi_mismatch_type.html) """ raise NotImplementedError @@ -2273,7 +2273,7 @@ def mismatch_summary(mismatch: Mismatch) -> str: """ Get a summary of a mismatch. - [Rust `pactffi_mismatch_summary`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_mismatch_summary.html) + [Rust `pactffi_mismatch_summary`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/fn.pactffi_mismatch_summary.html) """ raise NotImplementedError @@ -2282,7 +2282,7 @@ def mismatch_description(mismatch: Mismatch) -> str: """ Get a description of a mismatch. - [Rust `pactffi_mismatch_description`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/fn.pactffi_mismatch_description.html) + [Rust `pactffi_mismatch_description`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/fn.pactffi_mismatch_description.html) """ raise NotImplementedError @@ -2291,7 +2291,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.10/pact_ffi/fn.pactffi_mismatch_ansi_description.html) + [Rust `pactffi_mismatch_ansi_description`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/fn.pactffi_mismatch_ansi_description.html) """ raise NotImplementedError @@ -2301,7 +2301,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.10/pact_ffi/error/ffi/fn.pactffi_get_error_message.html) + `pactffi_get_error_message`](https://docs.rs/pact_ffi/0.5.12/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 @@ -2359,7 +2359,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.10/pact_ffi/log/ffi/fn.pactffi_log_to_stdout.html) + [Rust `pactffi_log_to_stdout`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/log/ffi/fn.pactffi_log_to_stdout.html) """ raise NotImplementedError @@ -2373,7 +2373,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.10/pact_ffi/log/ffi/fn.pactffi_log_to_stderr.html) + `pactffi_log_to_stderr`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/log/ffi/fn.pactffi_log_to_stderr.html) Args: level_filter: @@ -2402,7 +2402,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.10/pact_ffi/log/ffi/fn.pactffi_log_to_file.html) + `pactffi_log_to_file`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/log/ffi/fn.pactffi_log_to_file.html) # Safety @@ -2420,7 +2420,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.10/pact_ffi/log/ffi/fn.pactffi_log_to_buffer.html) + [Rust `pactffi_log_to_buffer`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/log/ffi/fn.pactffi_log_to_buffer.html) Raises: RuntimeError: @@ -2438,7 +2438,7 @@ def logger_init() -> None: """ Initialize the FFI logger with no sinks. - [Rust `pactffi_logger_init`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/log/ffi/fn.pactffi_logger_init.html) + [Rust `pactffi_logger_init`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/log/ffi/fn.pactffi_logger_init.html) This initialized logger does nothing until `pactffi_logger_apply` has been called. @@ -2460,7 +2460,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.10/pact_ffi/log/ffi/fn.pactffi_logger_attach_sink.html) + `pactffi_logger_attach_sink`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/log/ffi/fn.pactffi_logger_attach_sink.html) This logger does nothing until `pactffi_logger_apply` has been called. @@ -2507,7 +2507,7 @@ 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.10/pact_ffi/log/ffi/fn.pactffi_logger_apply.html) + `pactffi_logger_apply`](https://docs.rs/pact_ffi/0.5.12/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. @@ -2542,10 +2542,11 @@ def register_log_callback(callback: LogCallback | None) -> None: 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. + Registering a new callback replaces any previously registered one. Once + this function returns, the previous callback is no longer invoked. [Rust - `pactffi_register_log_callback`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/log/ffi/fn.pactffi_register_log_callback.html) + `pactffi_register_log_callback`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/log/ffi/fn.pactffi_register_log_callback.html) Args: callback: @@ -2599,7 +2600,7 @@ def set_log_callback_level(level_filter: LevelFilter | str) -> None: 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) + `pactffi_set_log_callback_level`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/log/ffi/fn.pactffi_set_log_callback_level.html) Args: level_filter: @@ -2617,7 +2618,7 @@ 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.10/pact_ffi/log/ffi/fn.pactffi_fetch_log_buffer.html) + `pactffi_fetch_log_buffer`](https://docs.rs/pact_ffi/0.5.12/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 @@ -2643,7 +2644,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.10/pact_ffi/models/fn.pactffi_parse_pact_json.html) + `pactffi_parse_pact_json`](https://docs.rs/pact_ffi/0.5.12/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. @@ -2660,7 +2661,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.10/pact_ffi/models/fn.pactffi_pact_model_delete.html) + [Rust `pactffi_pact_model_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/fn.pactffi_pact_model_delete.html) """ lib.pactffi_pact_model_delete(pact._ptr) @@ -2670,7 +2671,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.10/pact_ffi/models/fn.pactffi_pact_model_interaction_iterator.html) + `pactffi_pact_model_interaction_iterator`](https://docs.rs/pact_ffi/0.5.12/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 @@ -2692,7 +2693,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.10/pact_ffi/models/fn.pactffi_pact_spec_version.html) + [Rust `pactffi_pact_spec_version`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/fn.pactffi_pact_spec_version.html) """ raise NotImplementedError @@ -2701,7 +2702,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.10/pact_ffi/models/fn.pactffi_pact_interaction_delete.html) + [Rust `pactffi_pact_interaction_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/fn.pactffi_pact_interaction_delete.html) """ lib.pactffi_pact_interaction_delete(interaction._ptr) @@ -2710,7 +2711,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.10/pact_ffi/models/async_message/fn.pactffi_async_message_new.html) + [Rust `pactffi_async_message_new`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/async_message/fn.pactffi_async_message_new.html) # Safety @@ -2727,7 +2728,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.10/pact_ffi/models/async_message/fn.pactffi_async_message_delete.html) + [Rust `pactffi_async_message_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/async_message/fn.pactffi_async_message_delete.html) """ lib.pactffi_async_message_delete(message._ptr) @@ -2737,7 +2738,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.10/pact_ffi/models/async_message/fn.pactffi_async_message_get_contents.html) + `pactffi_async_message_get_contents`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/async_message/fn.pactffi_async_message_get_contents.html) If the message contents are missing, this function will return `None`. """ @@ -2756,7 +2757,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.10/pact_ffi/models/async_message/fn.pactffi_async_message_generate_contents.html) + `pactffi_async_message_generate_contents`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/async_message/fn.pactffi_async_message_generate_contents.html) If the message contents are missing, this function will return `None`. """ @@ -2770,7 +2771,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.10/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.12/pact_ffi/models/async_message/fn.pactffi_async_message_get_contents_str.html) # Safety @@ -2797,7 +2798,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.10/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.12/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 @@ -2825,7 +2826,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.10/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.12/pact_ffi/models/async_message/fn.pactffi_async_message_get_contents_length.html) # Safety @@ -2844,7 +2845,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.10/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.12/pact_ffi/models/async_message/fn.pactffi_async_message_get_contents_bin.html) # Safety @@ -2871,7 +2872,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.10/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.12/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 @@ -2898,7 +2899,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.10/pact_ffi/models/async_message/fn.pactffi_async_message_get_description.html) + `pactffi_async_message_get_description`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/async_message/fn.pactffi_async_message_get_description.html) Raises: RuntimeError: @@ -2918,7 +2919,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.10/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.12/pact_ffi/models/async_message/fn.pactffi_async_message_set_description.html) # Safety @@ -2943,7 +2944,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.10/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.12/pact_ffi/models/async_message/fn.pactffi_async_message_get_provider_state.html) Raises: RuntimeError: @@ -2962,7 +2963,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.10/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.12/pact_ffi/models/async_message/fn.pactffi_async_message_get_provider_state_iter.html) # Safety @@ -2977,7 +2978,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.10/pact_ffi/models/consumer/fn.pactffi_consumer_get_name.html) + [Rust `pactffi_consumer_get_name`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/consumer/fn.pactffi_consumer_get_name.html) The copy must be deleted with `pactffi_string_delete`. @@ -3023,7 +3024,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.10/pact_ffi/models/consumer/fn.pactffi_pact_get_consumer.html) + `pactffi_pact_get_consumer`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/consumer/fn.pactffi_pact_get_consumer.html) # Errors @@ -3037,7 +3038,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.10/pact_ffi/models/consumer/fn.pactffi_pact_consumer_delete.html) + [Rust `pactffi_pact_consumer_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/consumer/fn.pactffi_pact_consumer_delete.html) """ raise NotImplementedError @@ -3053,7 +3054,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.10/pact_ffi/models/contents/fn.pactffi_message_contents_delete.html) + [Rust `pactffi_message_contents_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/contents/fn.pactffi_message_contents_delete.html) """ lib.pactffi_message_contents_delete(contents._ptr) @@ -3062,7 +3063,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.10/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.12/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`. @@ -3082,7 +3083,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.10/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.12/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 @@ -3109,7 +3110,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.10/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.12/pact_ffi/models/contents/fn.pactffi_message_contents_get_contents_length.html) If the message has not contents, this function will return 0. """ @@ -3121,7 +3122,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.10/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.12/pact_ffi/models/contents/fn.pactffi_message_contents_get_contents_bin.html) If the message has no contents, this function will return `None`. """ @@ -3144,7 +3145,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.10/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.12/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 @@ -3173,7 +3174,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.10/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.12/pact_ffi/models/contents/fn.pactffi_message_contents_get_metadata_iter.html) # Safety @@ -3202,7 +3203,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.10/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.12/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. @@ -3244,7 +3245,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.10/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.12/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. @@ -3281,7 +3282,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.10/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.12/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. @@ -3319,7 +3320,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.10/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.12/pact_ffi/models/contents/fn.pactffi_message_contents_get_generators_iter.html) # Safety @@ -3345,7 +3346,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.10/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.12/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. @@ -3370,7 +3371,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.10/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.12/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. @@ -3395,7 +3396,7 @@ def parse_matcher_definition(expression: str) -> MatchingRuleDefinitionResult: any generator. [Rust - `pactffi_parse_matcher_definition`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/expressions/fn.pactffi_parse_matcher_definition.html) + `pactffi_parse_matcher_definition`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/expressions/fn.pactffi_parse_matcher_definition.html) The following are examples of matching rule definitions: @@ -3431,7 +3432,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.10/pact_ffi/models/expressions/fn.pactffi_matcher_definition_error.html) + `pactffi_matcher_definition_error`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/expressions/fn.pactffi_matcher_definition_error.html) """ raise NotImplementedError @@ -3445,7 +3446,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.10/pact_ffi/models/expressions/fn.pactffi_matcher_definition_value.html) + `pactffi_matcher_definition_value`](https://docs.rs/pact_ffi/0.5.12/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 @@ -3459,7 +3460,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.10/pact_ffi/models/expressions/fn.pactffi_matcher_definition_delete.html) + [Rust `pactffi_matcher_definition_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/expressions/fn.pactffi_matcher_definition_delete.html) """ raise NotImplementedError @@ -3472,7 +3473,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.10/pact_ffi/models/expressions/fn.pactffi_matcher_definition_generator.html) + `pactffi_matcher_definition_generator`](https://docs.rs/pact_ffi/0.5.12/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. @@ -3491,7 +3492,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.10/pact_ffi/models/expressions/fn.pactffi_matcher_definition_value_type.html) + `pactffi_matcher_definition_value_type`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/expressions/fn.pactffi_matcher_definition_value_type.html) """ raise NotImplementedError @@ -3500,7 +3501,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.10/pact_ffi/models/expressions/fn.pactffi_matching_rule_iter_delete.html) + [Rust `pactffi_matching_rule_iter_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/expressions/fn.pactffi_matching_rule_iter_delete.html) """ raise NotImplementedError @@ -3515,7 +3516,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.10/pact_ffi/models/expressions/fn.pactffi_matcher_definition_iter.html) + `pactffi_matcher_definition_iter`](https://docs.rs/pact_ffi/0.5.12/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. @@ -3531,7 +3532,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.10/pact_ffi/models/expressions/fn.pactffi_matching_rule_iter_next.html) + `pactffi_matching_rule_iter_next`](https://docs.rs/pact_ffi/0.5.12/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. @@ -3553,7 +3554,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.10/pact_ffi/models/expressions/fn.pactffi_matching_rule_id.html) + `pactffi_matching_rule_id`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/expressions/fn.pactffi_matching_rule_id.html) The ID corresponds to the following rules: @@ -3605,7 +3606,7 @@ def matching_rule_value(rule_result: MatchingRuleResult) -> str: pointer. [Rust - `pactffi_matching_rule_value`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/expressions/fn.pactffi_matching_rule_value.html) + `pactffi_matching_rule_value`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/expressions/fn.pactffi_matching_rule_value.html) The associated values for the rules are: @@ -3654,7 +3655,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.10/pact_ffi/models/expressions/fn.pactffi_matching_rule_pointer.html) + `pactffi_matching_rule_pointer`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/expressions/fn.pactffi_matching_rule_pointer.html) # Safety @@ -3672,7 +3673,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.10/pact_ffi/models/expressions/fn.pactffi_matching_rule_reference_name.html) + `pactffi_matching_rule_reference_name`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/expressions/fn.pactffi_matching_rule_reference_name.html) ```json { @@ -3699,7 +3700,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.10/pact_ffi/models/expressions/fn.pactffi_validate_datetime.html) + `pactffi_validate_datetime`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/expressions/fn.pactffi_validate_datetime.html) Raises: ValueError: @@ -3726,7 +3727,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.10/pact_ffi/models/generators/fn.pactffi_generator_to_json.html) + `pactffi_generator_to_json`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/generators/fn.pactffi_generator_to_json.html) The returned string must be deleted with `pactffi_string_delete`. @@ -3749,7 +3750,7 @@ def generator_generate_string(generator: Generator, context_json: str) -> str: function). [Rust - `pactffi_generator_generate_string`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/models/generators/fn.pactffi_generator_generate_string.html) + `pactffi_generator_generate_string`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/generators/fn.pactffi_generator_generate_string.html) If anything goes wrong, it will return a NULL pointer. """ @@ -3772,7 +3773,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.10/pact_ffi/models/generators/fn.pactffi_generator_generate_integer.html) + `pactffi_generator_generate_integer`](https://docs.rs/pact_ffi/0.5.12/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. @@ -3788,7 +3789,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.10/pact_ffi/models/generators/fn.pactffi_generators_iter_delete.html) + `pactffi_generators_iter_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/generators/fn.pactffi_generators_iter_delete.html) """ lib.pactffi_generators_iter_delete(iter._ptr) @@ -3798,7 +3799,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.10/pact_ffi/models/generators/fn.pactffi_generators_iter_next.html) + `pactffi_generators_iter_next`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/generators/fn.pactffi_generators_iter_next.html) The returned pointer must be deleted with `pactffi_generator_iter_pair_delete`. @@ -3818,7 +3819,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.10/pact_ffi/models/generators/fn.pactffi_generators_iter_pair_delete.html) + `pactffi_generators_iter_pair_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/generators/fn.pactffi_generators_iter_pair_delete.html) """ lib.pactffi_generators_iter_pair_delete(pair._ptr) @@ -3827,7 +3828,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.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_new.html) + [Rust `pactffi_sync_http_new`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/http_interaction/fn.pactffi_sync_http_new.html) # Safety @@ -3845,7 +3846,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.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_delete.html) + `pactffi_sync_http_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/http_interaction/fn.pactffi_sync_http_delete.html) """ lib.pactffi_sync_http_delete(interaction._ptr) @@ -3855,7 +3856,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.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_request.html) + `pactffi_sync_http_get_request`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_request.html) # Safety @@ -3875,7 +3876,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.10/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.12/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`. @@ -3895,7 +3896,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.10/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.12/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 @@ -3923,7 +3924,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.10/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.12/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_request_contents_length.html) This function will return 0 if the body is missing. """ @@ -3935,7 +3936,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.10/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.12/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`. @@ -3959,7 +3960,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.10/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.12/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 @@ -3986,7 +3987,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.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_response.html) + `pactffi_sync_http_get_response`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_response.html) # Safety @@ -4006,7 +4007,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.10/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.12/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`. @@ -4026,7 +4027,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.10/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.12/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 @@ -4054,7 +4055,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.10/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.12/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_response_contents_length.html) This function will return 0 if the body is missing. """ @@ -4066,7 +4067,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.10/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.12/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`. @@ -4090,7 +4091,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.10/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.12/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 @@ -4117,7 +4118,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.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_description.html) + `pactffi_sync_http_get_description`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_description.html) Raises: RuntimeError: @@ -4135,7 +4136,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.10/pact_ffi/models/http_interaction/fn.pactffi_sync_http_set_description.html) + `pactffi_sync_http_set_description`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/http_interaction/fn.pactffi_sync_http_set_description.html) # Safety @@ -4160,7 +4161,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.10/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.12/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_provider_state.html) # Safety @@ -4186,7 +4187,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.10/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.12/pact_ffi/models/http_interaction/fn.pactffi_sync_http_get_provider_state_iter.html) # Safety @@ -4209,7 +4210,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.10/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.12/pact_ffi/models/interactions/fn.pactffi_pact_interaction_as_synchronous_http.html) Args: interaction: @@ -4239,7 +4240,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.10/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.12/pact_ffi/models/interactions/fn.pactffi_pact_interaction_as_asynchronous_message.html) Args: interaction: @@ -4266,7 +4267,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.10/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.12/pact_ffi/models/interactions/fn.pactffi_pact_interaction_as_synchronous_message.html) Args: interaction: @@ -4292,7 +4293,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.10/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.12/pact_ffi/models/iterators/fn.pactffi_pact_async_message_iter_next.html) Raises: StopIteration: @@ -4309,7 +4310,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.10/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.12/pact_ffi/models/iterators/fn.pactffi_pact_async_message_iter_delete.html) """ lib.pactffi_pact_async_message_iter_delete(iter._ptr) @@ -4319,7 +4320,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.10/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.12/pact_ffi/models/iterators/fn.pactffi_pact_sync_message_iter_next.html) Raises: StopIteration: @@ -4336,7 +4337,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.10/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.12/pact_ffi/models/iterators/fn.pactffi_pact_sync_message_iter_delete.html) """ lib.pactffi_pact_sync_message_iter_delete(iter._ptr) @@ -4346,7 +4347,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.10/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.12/pact_ffi/models/iterators/fn.pactffi_pact_sync_http_iter_next.html) Raises: StopIteration: @@ -4363,7 +4364,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.10/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.12/pact_ffi/models/iterators/fn.pactffi_pact_sync_http_iter_delete.html) """ lib.pactffi_pact_sync_http_iter_delete(iter._ptr) @@ -4373,7 +4374,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.10/pact_ffi/models/iterators/fn.pactffi_pact_interaction_iter_next.html) + `pactffi_pact_interaction_iter_next`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/iterators/fn.pactffi_pact_interaction_iter_next.html) Raises: StopIteration: @@ -4390,7 +4391,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.10/pact_ffi/models/iterators/fn.pactffi_pact_interaction_iter_delete.html) + `pactffi_pact_interaction_iter_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/iterators/fn.pactffi_pact_interaction_iter_delete.html) """ lib.pactffi_pact_interaction_iter_delete(iter._ptr) @@ -4400,7 +4401,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.10/pact_ffi/models/iterators/fn.pactffi_pact_message_iter_next.html) + `pactffi_pact_message_iter_next`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/iterators/fn.pactffi_pact_message_iter_next.html) Raises: StopIteration: @@ -4417,7 +4418,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.10/pact_ffi/models/iterators/fn.pactffi_pact_message_iter_delete.html) + `pactffi_pact_message_iter_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/iterators/fn.pactffi_pact_message_iter_delete.html) """ lib.pactffi_pact_message_iter_delete(iter._ptr) @@ -4427,7 +4428,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.10/pact_ffi/models/matching_rules/fn.pactffi_matching_rule_to_json.html) + `pactffi_matching_rule_to_json`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/matching_rules/fn.pactffi_matching_rule_to_json.html) The returned string must be deleted with `pactffi_string_delete`. @@ -4444,7 +4445,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.10/pact_ffi/models/matching_rules/fn.pactffi_matching_rules_iter_delete.html) + `pactffi_matching_rules_iter_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/matching_rules/fn.pactffi_matching_rules_iter_delete.html) """ lib.pactffi_matching_rules_iter_delete(iter._ptr) @@ -4456,7 +4457,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.10/pact_ffi/models/matching_rules/fn.pactffi_matching_rules_iter_next.html) + `pactffi_matching_rules_iter_next`](https://docs.rs/pact_ffi/0.5.12/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`. @@ -4478,7 +4479,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.10/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.12/pact_ffi/models/matching_rules/fn.pactffi_matching_rules_iter_pair_delete.html) """ lib.pactffi_matching_rules_iter_pair_delete(pair._ptr) @@ -4488,7 +4489,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.10/pact_ffi/models/message/fn.pactffi_provider_state_iter_next.html) + `pactffi_provider_state_iter_next`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/message/fn.pactffi_provider_state_iter_next.html) # Safety @@ -4509,7 +4510,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.10/pact_ffi/models/message/fn.pactffi_provider_state_iter_delete.html) + `pactffi_provider_state_iter_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/message/fn.pactffi_provider_state_iter_delete.html) """ lib.pactffi_provider_state_iter_delete(iter._ptr) @@ -4519,7 +4520,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.10/pact_ffi/models/message/fn.pactffi_message_metadata_iter_next.html) + `pactffi_message_metadata_iter_next`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/message/fn.pactffi_message_metadata_iter_next.html) The returned pointer must be deleted with `pactffi_message_metadata_pair_delete`. @@ -4545,7 +4546,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.10/pact_ffi/models/message/fn.pactffi_message_metadata_iter_delete.html) + `pactffi_message_metadata_iter_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/message/fn.pactffi_message_metadata_iter_delete.html) """ lib.pactffi_message_metadata_iter_delete(iter._ptr) @@ -4555,7 +4556,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.10/pact_ffi/models/message/fn.pactffi_message_metadata_pair_delete.html) + `pactffi_message_metadata_pair_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/message/fn.pactffi_message_metadata_pair_delete.html) """ lib.pactffi_message_metadata_pair_delete(pair._ptr) @@ -4565,7 +4566,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.10/pact_ffi/models/provider/fn.pactffi_provider_get_name.html) + `pactffi_provider_get_name`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/provider/fn.pactffi_provider_get_name.html) The copy must be deleted with `pactffi_string_delete`. @@ -4611,7 +4612,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.10/pact_ffi/models/provider/fn.pactffi_pact_get_provider.html) + `pactffi_pact_get_provider`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/provider/fn.pactffi_pact_get_provider.html) # Errors @@ -4626,7 +4627,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.10/pact_ffi/models/provider/fn.pactffi_pact_provider_delete.html) + `pactffi_pact_provider_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/provider/fn.pactffi_pact_provider_delete.html) """ raise NotImplementedError @@ -4636,7 +4637,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.10/pact_ffi/models/provider_state/fn.pactffi_provider_state_get_name.html) + `pactffi_provider_state_get_name`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/provider_state/fn.pactffi_provider_state_get_name.html) Raises: RuntimeError: @@ -4656,7 +4657,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.10/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.12/pact_ffi/models/provider_state/fn.pactffi_provider_state_get_param_iter.html) # Safety @@ -4684,7 +4685,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.10/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.12/pact_ffi/models/provider_state/fn.pactffi_provider_state_param_iter_next.html) # Safety @@ -4705,7 +4706,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.10/pact_ffi/models/provider_state/fn.pactffi_provider_state_delete.html) + `pactffi_provider_state_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/provider_state/fn.pactffi_provider_state_delete.html) """ raise NotImplementedError @@ -4715,7 +4716,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.10/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.12/pact_ffi/models/provider_state/fn.pactffi_provider_state_param_iter_delete.html) """ lib.pactffi_provider_state_param_iter_delete(iter._ptr) @@ -4725,7 +4726,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.10/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.12/pact_ffi/models/provider_state/fn.pactffi_provider_state_param_pair_delete.html) """ lib.pactffi_provider_state_param_pair_delete(pair._ptr) @@ -4735,7 +4736,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.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_new.html) + `pactffi_sync_message_new`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/sync_message/fn.pactffi_sync_message_new.html) # Safety @@ -4753,7 +4754,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.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_delete.html) + `pactffi_sync_message_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/sync_message/fn.pactffi_sync_message_delete.html) """ lib.pactffi_sync_message_delete(message._ptr) @@ -4763,7 +4764,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.10/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.12/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_request_contents_str.html) # Safety @@ -4790,7 +4791,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.10/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.12/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 @@ -4818,7 +4819,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.10/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.12/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_request_contents_length.html) # Safety @@ -4837,7 +4838,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.10/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.12/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_request_contents_bin.html) # Safety @@ -4864,7 +4865,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.10/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.12/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 @@ -4891,7 +4892,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.10/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.12/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_request_contents.html) # Safety @@ -4918,7 +4919,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.10/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.12/pact_ffi/models/sync_message/fn.pactffi_sync_message_generate_request_contents.html) Raises: RuntimeError: @@ -4936,7 +4937,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.10/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.12/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_number_responses.html) If the message is null, this function will return 0. """ @@ -4951,7 +4952,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.10/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.12/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_response_contents_str.html) # Safety @@ -4984,7 +4985,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.10/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.12/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. @@ -5016,7 +5017,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.10/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.12/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_response_contents_length.html) # Safety @@ -5038,7 +5039,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.10/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.12/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_response_contents_bin.html) # Safety @@ -5069,7 +5070,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.10/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.12/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 @@ -5100,7 +5101,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.10/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.12/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_response_contents.html) # Safety @@ -5129,7 +5130,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.10/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.12/pact_ffi/models/sync_message/fn.pactffi_sync_message_generate_response_contents.html) Raises: RuntimeError: @@ -5147,7 +5148,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.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_description.html) + `pactffi_sync_message_get_description`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_description.html) Raises: RuntimeError: @@ -5165,7 +5166,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.10/pact_ffi/models/sync_message/fn.pactffi_sync_message_set_description.html) + `pactffi_sync_message_set_description`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/models/sync_message/fn.pactffi_sync_message_set_description.html) # Safety @@ -5190,7 +5191,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.10/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.12/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_provider_state.html) # Safety @@ -5216,7 +5217,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.10/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.12/pact_ffi/models/sync_message/fn.pactffi_sync_message_get_provider_state_iter.html) # Safety @@ -5238,7 +5239,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.10/pact_ffi/fn.pactffi_string_delete.html) + `pactffi_string_delete`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/fn.pactffi_string_delete.html) """ lib.pactffi_string_delete(string._ptr) @@ -5248,7 +5249,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.10/pact_ffi/mock_server/fn.pactffi_get_tls_ca_certificate.html) + `pactffi_get_tls_ca_certificate`](https://docs.rs/pact_ffi/0.5.12/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]. @@ -5271,7 +5272,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.10/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.12/pact_ffi/mock_server/fn.pactffi_create_mock_server_for_transport.html) Args: pact: @@ -5337,7 +5338,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.10/pact_ffi/mock_server/fn.pactffi_mock_server_matched.html) + `pactffi_mock_server_matched`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/fn.pactffi_mock_server_matched.html) """ return lib.pactffi_mock_server_matched(mock_server_handle._ref) @@ -5349,7 +5350,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.10/pact_ffi/mock_server/fn.pactffi_mock_server_mismatches.html) + `pactffi_mock_server_mismatches`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/fn.pactffi_mock_server_mismatches.html) # Errors @@ -5376,7 +5377,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.10/pact_ffi/mock_server/fn.pactffi_cleanup_mock_server.html) + `pactffi_cleanup_mock_server`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/fn.pactffi_cleanup_mock_server.html) Args: mock_server_handle: @@ -5405,7 +5406,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.10/pact_ffi/mock_server/fn.pactffi_write_pact_file.html) + `pactffi_write_pact_file`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/fn.pactffi_write_pact_file.html) Args: mock_server_handle: @@ -5457,7 +5458,7 @@ def mock_server_logs(mock_server_handle: PactServerHandle) -> str: started. [Rust - `pactffi_mock_server_logs`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/fn.pactffi_mock_server_logs.html) + `pactffi_mock_server_logs`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/fn.pactffi_mock_server_logs.html) Raises: RuntimeError: @@ -5481,7 +5482,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.10/pact_ffi/mock_server/fn.pactffi_generate_datetime_string.html) + `pactffi_generate_datetime_string`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/fn.pactffi_generate_datetime_string.html) # Safety @@ -5498,7 +5499,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.10/pact_ffi/mock_server/fn.pactffi_check_regex.html) + `pactffi_check_regex`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/fn.pactffi_check_regex.html) # Safety @@ -5517,7 +5518,7 @@ def generate_regex_value(regex: str) -> StringResult: `pactffi_string_delete` function. [Rust - `pactffi_generate_regex_value`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/fn.pactffi_generate_regex_value.html) + `pactffi_generate_regex_value`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/fn.pactffi_generate_regex_value.html) # Safety @@ -5532,7 +5533,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.10/pact_ffi/mock_server/fn.pactffi_free_string.html) + `pactffi_free_string`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/fn.pactffi_free_string.html) This function is deprecated. Use `pactffi_string_delete` instead. @@ -5554,7 +5555,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.10/pact_ffi/mock_server/handles/fn.pactffi_new_pact.html) + `pactffi_new_pact`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_new_pact.html) Args: consumer_name: @@ -5607,7 +5608,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.10/pact_ffi/mock_server/handles/fn.pactffi_new_interaction.html) + `pactffi_new_interaction`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_new_interaction.html) Args: pact: @@ -5635,7 +5636,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.10/pact_ffi/mock_server/handles/fn.pactffi_new_message_interaction.html) + `pactffi_new_message_interaction`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_new_message_interaction.html) Args: pact: @@ -5666,7 +5667,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.10/pact_ffi/mock_server/handles/fn.pactffi_new_sync_message_interaction.html) + `pactffi_new_sync_message_interaction`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_new_sync_message_interaction.html) Args: pact: @@ -5691,7 +5692,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.10/pact_ffi/mock_server/handles/fn.pactffi_upon_receiving.html) + `pactffi_upon_receiving`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_upon_receiving.html) This function @@ -5732,7 +5733,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.10/pact_ffi/mock_server/handles/fn.pactffi_given.html) + `pactffi_given`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_given.html) Args: interaction: @@ -5759,7 +5760,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.10/pact_ffi/mock_server/handles/fn.pactffi_interaction_test_name.html) + `pactffi_interaction_test_name`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_interaction_test_name.html) Args: interaction: @@ -5806,7 +5807,7 @@ def given_with_param( be parsed as JSON. [Rust - `pactffi_given_with_param`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_given_with_param.html) + `pactffi_given_with_param`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_given_with_param.html) Args: interaction: @@ -5848,7 +5849,7 @@ def given_with_params( with a `value` key. [Rust - `pactffi_given_with_params`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_given_with_params.html) + `pactffi_given_with_params`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_given_with_params.html) Args: interaction: @@ -5887,7 +5888,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.10/pact_ffi/mock_server/handles/fn.pactffi_with_request.html) + `pactffi_with_request`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_with_request.html) Args: interaction: @@ -5901,7 +5902,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.10/rust/pact_ffi/IntegrationJson.md) + rule](https://github.com/pact-foundation/pact-reference/blob/pact_ffi-v0.5.12/rust/pact_ffi/IntegrationJson.md) which allows regex patterns. For examples: ```json @@ -5936,7 +5937,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.10/pact_ffi/mock_server/handles/fn.pactffi_with_query_parameter_v2.html) + `pactffi_with_query_parameter_v2`](https://docs.rs/pact_ffi/0.5.12/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: @@ -5973,7 +5974,7 @@ def with_query_parameter_v2( ) ``` - See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.10/rust/pact_ffi/IntegrationJson.md) + See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/pact_ffi-v0.5.12/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. @@ -6025,7 +6026,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.10/rust/pact_ffi/IntegrationJson.md). + rule](https://github.com/pact-foundation/pact-reference/blob/pact_ffi-v0.5.12/rust/pact_ffi/IntegrationJson.md). Raises: RuntimeError: @@ -6047,7 +6048,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.10/pact_ffi/mock_server/handles/fn.pactffi_with_specification.html) + `pactffi_with_specification`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_with_specification.html) Args: pact: @@ -6071,7 +6072,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.10/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.12/pact_ffi/mock_server/handles/fn.pactffi_handle_get_pact_spec_version.html) Args: handle: @@ -6097,7 +6098,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.10/pact_ffi/mock_server/handles/fn.pactffi_with_pact_metadata.html) + `pactffi_with_pact_metadata`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_with_pact_metadata.html) Args: pact: @@ -6163,7 +6164,7 @@ def with_metadata( ``` See - [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.10/rust/pact_ffi/IntegrationJson.md) + [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/pact_ffi-v0.5.12/rust/pact_ffi/IntegrationJson.md) # Note @@ -6212,7 +6213,7 @@ def with_header_v2( r""" Configures a header for the Interaction. - [Rust `pactffi_with_header_v2`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_header_v2.html) + [Rust `pactffi_with_header_v2`](https://docs.rs/pact_ffi/0.5.12/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: @@ -6250,7 +6251,7 @@ def with_header_v2( ) ``` - See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/libpact_ffi-v0.5.10/rust/pact_ffi/IntegrationJson.md) + See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/pact_ffi-v0.5.12/rust/pact_ffi/IntegrationJson.md) Args: interaction: @@ -6272,7 +6273,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.10/rust/pact_ffi/IntegrationJson.md). + rule](https://github.com/pact-foundation/pact-reference/blob/pact_ffi-v0.5.12/rust/pact_ffi/IntegrationJson.md). Raises: RuntimeError: @@ -6304,7 +6305,7 @@ def set_header( and generators can not be configured with it. [Rust - `pactffi_set_header`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_set_header.html) + `pactffi_set_header`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_set_header.html) If matching rules are required to be set, use `pactffi_with_header_v2`. @@ -6342,7 +6343,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.10/pact_ffi/mock_server/handles/fn.pactffi_response_status.html) + `pactffi_response_status`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_response_status.html) Args: interaction: @@ -6366,7 +6367,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.10/pact_ffi/mock_server/handles/fn.pactffi_response_status_v2.html) + `pactffi_response_status_v2`](https://docs.rs/pact_ffi/0.5.12/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 @@ -6385,7 +6386,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.10/rust/pact_ffi/IntegrationJson.md) + See [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/pact_ffi-v0.5.12/rust/pact_ffi/IntegrationJson.md) Args: interaction: @@ -6396,7 +6397,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.10/rust/pact_ffi/IntegrationJson.md). + rule](https://github.com/pact-foundation/pact-reference/blob/pact_ffi-v0.5.12/rust/pact_ffi/IntegrationJson.md). Raises: RuntimeError: @@ -6420,7 +6421,7 @@ def with_body( Adds the body for the interaction. [Rust - `pactffi_with_body`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_body.html) + `pactffi_with_body`](https://docs.rs/pact_ffi/0.5.12/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) @@ -6455,7 +6456,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.10/rust/pact_ffi/IntegrationJson.md). + [IntegrationJson.md](https://github.com/pact-foundation/pact-reference/blob/pact_ffi-v0.5.12/rust/pact_ffi/IntegrationJson.md). Raises: RuntimeError: @@ -6482,7 +6483,7 @@ def with_binary_body( Adds the body for the interaction. [Rust - `pactffi_with_binary_body`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_binary_body.html) + `pactffi_with_binary_body`](https://docs.rs/pact_ffi/0.5.12/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 @@ -6542,7 +6543,7 @@ def with_binary_file( already started) [Rust - `pactffi_with_binary_file`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_binary_file.html) + `pactffi_with_binary_file`](https://docs.rs/pact_ffi/0.5.12/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 @@ -6589,7 +6590,7 @@ def with_matching_rules( Add matching rules to the interaction. [Rust - `pactffi_with_matching_rules`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_matching_rules.html) + `pactffi_with_matching_rules`](https://docs.rs/pact_ffi/0.5.12/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. @@ -6627,7 +6628,7 @@ def with_generators( Add generators to the interaction. [Rust - `pactffi_with_generators`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_generators.html) + `pactffi_with_generators`](https://docs.rs/pact_ffi/0.5.12/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). @@ -6675,7 +6676,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.10/pact_ffi/mock_server/handles/fn.pactffi_with_multipart_file_v2.html) + `pactffi_with_multipart_file_v2`](https://docs.rs/pact_ffi/0.5.12/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. @@ -6729,7 +6730,7 @@ def with_multipart_file( already started) or an error occurs. [Rust - `pactffi_with_multipart_file`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_with_multipart_file.html) + `pactffi_with_multipart_file`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_with_multipart_file.html) * `interaction` - Interaction handle to set the body for. * `part` - Request or response part. @@ -6766,7 +6767,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.10/pact_ffi/mock_server/handles/fn.pactffi_set_key.html) + `pactffi_set_key`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_set_key.html) Args: interaction: @@ -6794,7 +6795,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.10/pact_ffi/mock_server/handles/fn.pactffi_set_pending.html) + `pactffi_set_pending`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_set_pending.html) Args: interaction: @@ -6818,7 +6819,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.10/pact_ffi/mock_server/handles/fn.pactffi_set_comment.html) + `pactffi_set_comment`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_set_comment.html) Args: interaction: @@ -6852,7 +6853,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.10/pact_ffi/mock_server/handles/fn.pactffi_add_text_comment.html) + `pactffi_add_text_comment`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_add_text_comment.html) Args: interaction: @@ -6889,7 +6890,7 @@ def add_interaction_reference( reference, or a pull request reference. [Rust - `pactffi_add_interaction_reference`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/mock_server/handles/fn.pactffi_add_interaction_reference.html) + `pactffi_add_interaction_reference`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_add_interaction_reference.html) Args: interaction: @@ -6930,7 +6931,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.10/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.12/pact_ffi/mock_server/handles/fn.pactffi_pact_handle_get_sync_message_iter.html) # Safety @@ -6956,7 +6957,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.10/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.12/pact_ffi/mock_server/handles/fn.pactffi_pact_handle_get_sync_message_iter.html) # Safety @@ -6982,7 +6983,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.10/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.12/pact_ffi/mock_server/handles/fn.pactffi_pact_handle_get_sync_http_iter.html) # Safety @@ -7006,7 +7007,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.10/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.12/pact_ffi/mock_server/handles/fn.pactffi_pact_handle_get_message_iter.html) # Safety @@ -7033,7 +7034,7 @@ def sync_message_generate_contents(interaction: InteractionHandle) -> dict[str, 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) + `pactffi_sync_message_generate_contents`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_sync_message_generate_contents.html) Args: interaction: @@ -7056,6 +7057,61 @@ def sync_message_generate_contents(interaction: InteractionHandle) -> dict[str, return json.loads(contents) +def sync_message_match_response_contents( + interaction: InteractionHandle, + index: int, + content_type: str | None, + contents: str, +) -> list[dict[str, Any]]: + """ + Match contents against an expected response of a synchronous message. + + The response's matching rules are applied, as the verifier applies them to + a provider's response. A consumer test can use this to check the response + its handler produces. Only the response contents are compared, and + unexpected keys in the actual contents are allowed. + + [Rust + `pactffi_sync_message_match_response_contents`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_sync_message_match_response_contents.html) + + Args: + interaction: + Handle to a synchronous message interaction. + + index: + Index of the expected response, starting at 0. + + content_type: + Content type of `contents`. If `None`, the content type of the + expected response is used. + + contents: + The actual response contents. + + Returns: + The mismatches as a list of JSON objects. The list is empty if the + contents matched. + + Raises: + RuntimeError: + If the handle does not refer to a synchronous message interaction, + or `index` is out of range. + """ + ptr = lib.pactffi_sync_message_match_response_contents( + interaction._ref, + index, + content_type.encode("utf-8") if content_type else ffi.NULL, + contents.encode("utf-8"), + ) + if ptr == ffi.NULL: + msg = ( + f"{interaction} is not a synchronous message interaction, " + f"or it has no response at index {index}." + ) + raise RuntimeError(msg) + return json.loads(OwnedString(ptr)) + + def pact_handle_write_file( pact: PactHandle, directory: Path | str | None, @@ -7066,7 +7122,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.10/pact_ffi/mock_server/handles/fn.pactffi_pact_handle_write_file.html) + `pactffi_pact_handle_write_file`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_pact_handle_write_file.html) This function should be called if all the consumer tests have passed. @@ -7110,7 +7166,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.10/pact_ffi/mock_server/handles/fn.pactffi_free_pact_handle.html) + `pactffi_free_pact_handle`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/mock_server/handles/fn.pactffi_free_pact_handle.html) Raises: RuntimeError: @@ -7136,7 +7192,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.10/pact_ffi/verifier/fn.pactffi_verifier_new_for_application.html) + `pactffi_verifier_new_for_application`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/fn.pactffi_verifier_new_for_application.html) """ result: cffi.FFI.CData = lib.pactffi_verifier_new_for_application( b"pact-python", @@ -7149,7 +7205,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.10/pact_ffi/verifier/fn.pactffi_verifier_shutdown.html) + [Rust `pactffi_verifier_shutdown`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/fn.pactffi_verifier_shutdown.html) """ lib.pactffi_verifier_shutdown(handle._ref) @@ -7166,7 +7222,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.10/pact_ffi/verifier/fn.pactffi_verifier_set_provider_info.html) + `pactffi_verifier_set_provider_info`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/fn.pactffi_verifier_set_provider_info.html) Args: handle: @@ -7212,7 +7268,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.10/pact_ffi/verifier/fn.pactffi_verifier_add_provider_transport.html) + `pactffi_verifier_add_provider_transport`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/fn.pactffi_verifier_add_provider_transport.html) Args: handle: @@ -7253,7 +7309,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.10/pact_ffi/verifier/fn.pactffi_verifier_set_filter_info.html) + `pactffi_verifier_set_filter_info`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/fn.pactffi_verifier_set_filter_info.html) Set filters to narrow down the interactions to verify. @@ -7289,7 +7345,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.10/pact_ffi/verifier/fn.pactffi_verifier_set_provider_state.html) + `pactffi_verifier_set_provider_state`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/fn.pactffi_verifier_set_provider_state.html) Args: handle: @@ -7324,7 +7380,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.10/pact_ffi/verifier/fn.pactffi_verifier_set_verification_options.html) + `pactffi_verifier_set_verification_options`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/fn.pactffi_verifier_set_verification_options.html) Args: handle: @@ -7359,7 +7415,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.10/pact_ffi/verifier/fn.pactffi_verifier_set_coloured_output.html) + `pactffi_verifier_set_coloured_output`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/fn.pactffi_verifier_set_coloured_output.html) By default, coloured output is enabled. @@ -7388,7 +7444,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.10/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.12/pact_ffi/verifier/fn.pactffi_verifier_set_no_pacts_is_error.html) Args: handle: @@ -7421,7 +7477,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.10/pact_ffi/verifier/fn.pactffi_verifier_set_publish_options.html) + `pactffi_verifier_set_publish_options`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/fn.pactffi_verifier_set_publish_options.html) Args: handle: @@ -7464,7 +7520,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.10/pact_ffi/verifier/fn.pactffi_verifier_set_consumer_filters.html) + `pactffi_verifier_set_consumer_filters`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/fn.pactffi_verifier_set_consumer_filters.html) """ lib.pactffi_verifier_set_consumer_filters( handle._ref, @@ -7482,7 +7538,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.10/pact_ffi/verifier/fn.pactffi_verifier_add_custom_header.html) + `pactffi_verifier_add_custom_header`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/fn.pactffi_verifier_add_custom_header.html) """ lib.pactffi_verifier_add_custom_header( handle._ref, @@ -7500,7 +7556,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.10/pact_ffi/verifier/fn.pactffi_verifier_set_follow_redirects.html) + `pactffi_verifier_set_follow_redirects`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/fn.pactffi_verifier_set_follow_redirects.html) Args: handle: @@ -7521,7 +7577,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.10/pact_ffi/verifier/fn.pactffi_verifier_add_file_source.html) + `pactffi_verifier_add_file_source`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/fn.pactffi_verifier_add_file_source.html) """ lib.pactffi_verifier_add_file_source(handle._ref, file.encode("utf-8")) @@ -7533,7 +7589,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.10/pact_ffi/verifier/fn.pactffi_verifier_add_directory_source.html) + `pactffi_verifier_add_directory_source`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/fn.pactffi_verifier_add_directory_source.html) # Safety @@ -7555,7 +7611,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.10/pact_ffi/verifier/fn.pactffi_verifier_url_source.html) + `pactffi_verifier_url_source`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/fn.pactffi_verifier_url_source.html) Args: handle: @@ -7595,7 +7651,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.10/pact_ffi/verifier/fn.pactffi_verifier_broker_source.html) + `pactffi_verifier_broker_source`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/fn.pactffi_verifier_broker_source.html) This will fetch all the pact files from the broker that match the provider name. @@ -7643,7 +7699,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.10/pact_ffi/verifier/fn.pactffi_verifier_broker_source_with_selectors.html) + `pactffi_verifier_broker_source_with_selectors`](https://docs.rs/pact_ffi/0.5.12/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 @@ -7723,7 +7779,7 @@ def verifier_execute(handle: VerifierHandle) -> None: Runs the verification. [Rust - `pactffi_verifier_execute`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/verifier/fn.pactffi_verifier_execute.html) + `pactffi_verifier_execute`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/fn.pactffi_verifier_execute.html) Raises: RuntimeError: @@ -7740,7 +7796,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.10/pact_ffi/verifier/fn.pactffi_verifier_logs.html) + `pactffi_verifier_logs`](https://docs.rs/pact_ffi/0.5.12/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` @@ -7762,7 +7818,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.10/pact_ffi/verifier/fn.pactffi_verifier_logs_for_provider.html) + `pactffi_verifier_logs_for_provider`](https://docs.rs/pact_ffi/0.5.12/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` @@ -7784,7 +7840,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.10/pact_ffi/verifier/fn.pactffi_verifier_output.html) + `pactffi_verifier_output`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/verifier/fn.pactffi_verifier_output.html) Args: handle: @@ -7811,7 +7867,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.10/pact_ffi/verifier/fn.pactffi_verifier_json.html) + `pactffi_verifier_json`](https://docs.rs/pact_ffi/0.5.12/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 @@ -7848,7 +7904,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.10/pact_ffi/plugins/fn.pactffi_using_plugin_with_delay.html) + [Rust `pactffi_using_plugin_with_delay`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/plugins/fn.pactffi_using_plugin_with_delay.html) Args: pact: @@ -7903,7 +7959,7 @@ def using_plugin( otherwise you will have plugin processes left running. [Rust - `pactffi_using_plugin`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/plugins/fn.pactffi_using_plugin.html) + `pactffi_using_plugin`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/plugins/fn.pactffi_using_plugin.html) Args: pact: @@ -7946,7 +8002,7 @@ def cleanup_plugins(pact: PactHandle) -> None: zero). [Rust - `pactffi_cleanup_plugins`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/plugins/fn.pactffi_cleanup_plugins.html) + `pactffi_cleanup_plugins`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/plugins/fn.pactffi_cleanup_plugins.html) """ lib.pactffi_cleanup_plugins(pact._ref) @@ -7959,7 +8015,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.10/pact_ffi/plugins/fn.pactffi_set_test_run_id.html) + `pactffi_set_test_run_id`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/plugins/fn.pactffi_set_test_run_id.html) Args: test_run_id: @@ -7984,12 +8040,13 @@ def register_plugin_log_callback(callback: PluginLogCallback | None) -> None: plugin. It is invoked on the Pact library's own runtime thread, so it must be thread-safe, and it must not call back into the Pact FFI. - Registering a new callback replaces any previously registered one. + Registering a new callback replaces any previously registered one. Once + this function returns, the previous callback is no longer invoked. 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.10/pact_ffi/plugins/fn.pactffi_register_plugin_log_callback.html) + `pactffi_register_plugin_log_callback`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/plugins/fn.pactffi_register_plugin_log_callback.html) Args: callback: @@ -8022,7 +8079,10 @@ def _callback( _decode(message), ) - new_callback = ffi.callback("PluginLogCallback", _callback) + new_callback = ffi.callback( + "void(*)(const char *, const char *, const char *, const char *, const char *)", + _callback, + ) lib.pactffi_register_plugin_log_callback(new_callback) _plugin_log_callback = new_callback @@ -8040,7 +8100,7 @@ def get_plugin_logs(plugin_instance_id: str) -> list[dict[str, Any]]: `log_to_*` functions) or by registering a plugin log callback. [Rust - `pactffi_get_plugin_logs`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/plugins/fn.pactffi_get_plugin_logs.html) + `pactffi_get_plugin_logs`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/plugins/fn.pactffi_get_plugin_logs.html) Args: plugin_instance_id: @@ -8076,7 +8136,7 @@ def interaction_contents( format of the JSON contents. [Rust - `pactffi_interaction_contents`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/plugins/fn.pactffi_interaction_contents.html) + `pactffi_interaction_contents`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/plugins/fn.pactffi_interaction_contents.html) Args: interaction: @@ -8136,7 +8196,7 @@ def matches_string_value( function once it is no longer required. [Rust - `pactffi_matches_string_value`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/matching/fn.pactffi_matches_string_value.html) + `pactffi_matches_string_value`](https://docs.rs/pact_ffi/0.5.12/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 @@ -8167,7 +8227,7 @@ def matches_u64_value( function once it is no longer required. [Rust - `pactffi_matches_u64_value`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/matching/fn.pactffi_matches_u64_value.html) + `pactffi_matches_u64_value`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/matching/fn.pactffi_matches_u64_value.html) * matching_rule - pointer to a matching rule * expected_value - value we expect to get @@ -8197,7 +8257,7 @@ def matches_i64_value( function once it is no longer required. [Rust - `pactffi_matches_i64_value`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/matching/fn.pactffi_matches_i64_value.html) + `pactffi_matches_i64_value`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/matching/fn.pactffi_matches_i64_value.html) * matching_rule - pointer to a matching rule * expected_value - value we expect to get @@ -8227,7 +8287,7 @@ def matches_f64_value( function once it is no longer required. [Rust - `pactffi_matches_f64_value`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/matching/fn.pactffi_matches_f64_value.html) + `pactffi_matches_f64_value`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/matching/fn.pactffi_matches_f64_value.html) * matching_rule - pointer to a matching rule * expected_value - value we expect to get @@ -8257,7 +8317,7 @@ def matches_bool_value( function once it is no longer required. [Rust - `pactffi_matches_bool_value`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/matching/fn.pactffi_matches_bool_value.html) + `pactffi_matches_bool_value`](https://docs.rs/pact_ffi/0.5.12/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 @@ -8289,7 +8349,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.10/pact_ffi/matching/fn.pactffi_matches_binary_value.html) + `pactffi_matches_binary_value`](https://docs.rs/pact_ffi/0.5.12/pact_ffi/matching/fn.pactffi_matches_binary_value.html) * matching_rule - pointer to a matching rule * expected_value - value we expect to get @@ -8324,7 +8384,7 @@ def matches_json_value( function once it is no longer required. [Rust - `pactffi_matches_json_value`](https://docs.rs/pact_ffi/0.5.10/pact_ffi/matching/fn.pactffi_matches_json_value.html) + `pactffi_matches_json_value`](https://docs.rs/pact_ffi/0.5.12/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 39aecb5ab..960ad6a9c 100644 --- a/pact-python-ffi/tests/test_init.py +++ b/pact-python-ffi/tests/test_init.py @@ -304,6 +304,60 @@ def test_sync_message_generate_contents_http() -> None: pact_ffi.sync_message_generate_contents(interaction) +@pytest.mark.parametrize( + ("actual", "mismatched"), + [ + pytest.param({"id": 7, "extra": True}, False, id="match"), + pytest.param({"id": "7"}, True, id="mismatch"), + ], +) +def test_sync_message_match_response_contents( + actual: dict[str, object], + *, + mismatched: bool, +) -> 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.RESPONSE, + "application/json", + json.dumps({"id": {"value": 100, "pact:matcher:type": "integer"}}), + ) + + mismatches = pact_ffi.sync_message_match_response_contents( + interaction, + 0, + None, + json.dumps(actual), + ) + + assert bool(mismatches) == mismatched + + +@pytest.mark.parametrize( + ("kind", "index"), + [ + pytest.param("http", 0, id="http"), + pytest.param("sync", 1, id="index"), + ], +) +def test_sync_message_match_response_contents_invalid(kind: str, index: int) -> None: + pact = pact_ffi.new_pact("consumer", "provider") + if kind == "http": + interaction = pact_ffi.new_interaction(pact, "http") + else: + interaction = pact_ffi.new_sync_message_interaction(pact, "sync") + pact_ffi.with_body( + interaction, + pact_ffi.InteractionPart.RESPONSE, + "application/json", + json.dumps({"result": "ok"}), + ) + with pytest.raises(RuntimeError, match="not a synchronous message"): + pact_ffi.sync_message_match_response_contents(interaction, index, None, "{}") + + def test_log_callback() -> None: # Applying a logger installs a process-wide subscriber, so the test runs in # a separate interpreter. @@ -328,3 +382,10 @@ def test_log_callback() -> None: text=True, ) assert result.stdout.strip() == "[('INFO', 'pact_ffi', 'received source=test')]" + + +def test_register_plugin_log_callback() -> None: + # Entries only arrive from a running plugin, so this covers registration. + pact_ffi.register_plugin_log_callback(lambda *_: None) + pact_ffi.register_plugin_log_callback(lambda *_: None) + pact_ffi.register_plugin_log_callback(None)